From 4c21197963e4229a6cbd88993de1ac5fdbbf99c8 Mon Sep 17 00:00:00 2001 From: Artur Adib Date: Tue, 11 Sep 2012 16:08:07 -0700 Subject: [PATCH 1/2] fix gh-pages bloat --- make.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) mode change 100755 => 100644 make.js diff --git a/make.js b/make.js old mode 100755 new mode 100644 index e33a597e0..4ce67a6ce --- a/make.js +++ b/make.js @@ -255,21 +255,19 @@ target.bundle = function() { target.pagesrepo = function() { cd(ROOT_DIR); echo(); - echo('### Creating fresh clone of gh-pages'); + echo('### Creating a fresh git repo for gh-pages'); - if (!test('-d', BUILD_DIR)) - mkdir(BUILD_DIR); + if (test('-d', GH_PAGES_DIR)) + rm('-rf', GH_PAGES_DIR); - if (!test('-d', GH_PAGES_DIR)) { - echo(); - echo('Cloning project repo...'); - echo('(This operation can take a while, depending on network conditions)'); - exec('git clone -b gh-pages --depth=1 ' + REPO + ' ' + GH_PAGES_DIR, - {silent: true}); - echo('Done.'); - } + mkdir('-p', GH_PAGES_DIR); + var oldDir = pwd(); + cd(GH_PAGES_DIR); + exec('git init'); + exec('git remote add origin ' + REPO); + exec('git checkout --orphan gh-pages'); + cd(oldDir); - rm('-rf', GH_PAGES_DIR + '/*'); mkdir('-p', GH_PAGES_DIR + '/web'); mkdir('-p', GH_PAGES_DIR + '/web/images'); mkdir('-p', GH_PAGES_DIR + BUILD_DIR); From 790f60830b677d49b913a6f927faac62a53accbf Mon Sep 17 00:00:00 2001 From: Artur Adib Date: Wed, 12 Sep 2012 09:10:30 -0700 Subject: [PATCH 2/2] remove target.pagesrepo, commit here (not bot) --- make.js | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/make.js b/make.js index 4ce67a6ce..27afbef25 100644 --- a/make.js +++ b/make.js @@ -104,12 +104,19 @@ target.generic = function() { target.web = function() { target.generic(); target.extension(); - target.pagesrepo(); - cd(ROOT_DIR); echo(); echo('### Creating web site'); + if (test('-d', GH_PAGES_DIR)) + rm('-rf', GH_PAGES_DIR); + + mkdir('-p', GH_PAGES_DIR + '/web'); + mkdir('-p', GH_PAGES_DIR + '/web/images'); + mkdir('-p', GH_PAGES_DIR + BUILD_DIR); + mkdir('-p', GH_PAGES_DIR + EXTENSION_SRC_DIR + '/firefox'); + mkdir('-p', GH_PAGES_DIR + EXTENSION_SRC_DIR + '/chrome'); + cp('-R', GENERIC_DIR + '/*', GH_PAGES_DIR); cp(FIREFOX_BUILD_DIR + '/*.xpi', FIREFOX_BUILD_DIR + '/*.rdf', GH_PAGES_DIR + EXTENSION_SRC_DIR + 'firefox/'); @@ -118,12 +125,14 @@ target.web = function() { cp('web/index.html.template', GH_PAGES_DIR + '/index.html'); cd(GH_PAGES_DIR); + exec('git init'); + exec('git remote add origin ' + REPO); exec('git add -A'); + exec('git commit -am "gh-pages site created via make.js script"'); + exec('git branch -m gh-pages'); echo(); echo('Website built in ' + GH_PAGES_DIR); - echo('Don\'t forget to cd into ' + GH_PAGES_DIR + - ' and issue \'git commit\' to push changes.'); }; // @@ -245,36 +254,6 @@ target.bundle = function() { }; -// -// make pagesrepo -// -// This target clones the gh-pages repo into the build directory. It deletes -// the current contents of the repo, since we overwrite everything with data -// from the master repo. The 'make web' target then uses 'git add -A' to track -// additions, modifications, moves, and deletions. -target.pagesrepo = function() { - cd(ROOT_DIR); - echo(); - echo('### Creating a fresh git repo for gh-pages'); - - if (test('-d', GH_PAGES_DIR)) - rm('-rf', GH_PAGES_DIR); - - mkdir('-p', GH_PAGES_DIR); - var oldDir = pwd(); - cd(GH_PAGES_DIR); - exec('git init'); - exec('git remote add origin ' + REPO); - exec('git checkout --orphan gh-pages'); - cd(oldDir); - - mkdir('-p', GH_PAGES_DIR + '/web'); - mkdir('-p', GH_PAGES_DIR + '/web/images'); - mkdir('-p', GH_PAGES_DIR + BUILD_DIR); - mkdir('-p', GH_PAGES_DIR + EXTENSION_SRC_DIR + '/firefox'); - mkdir('-p', GH_PAGES_DIR + EXTENSION_SRC_DIR + '/chrome'); -}; - /////////////////////////////////////////////////////////////////////////////////////////// //