From fe02be69b564d6026a9f16cd8363fcd0794fa51a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 11 Apr 2016 16:26:06 -0700 Subject: [PATCH] Replace cp.js by shell commands. --- Gruntfile.coffee | 6 +++++- Makefile | 20 ++++++++++---------- tools/cp.js | 3 --- 3 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 tools/cp.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 9adde0509..786f14965 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -64,7 +64,6 @@ module.exports = (grunt) -> """.split('\n').join('&&') web: command: """ - node ../<%= pkg.meta.path %>/tools/cp.js ../<%= pkg.meta.path %>/test.html index.html git merge --no-commit -s ours master git checkout master README.md web.css img git commit -am "Update web page." @@ -176,9 +175,14 @@ module.exports = (grunt) -> 'popd' ] + grunt.registerTask 'copy-web', 'Copy test.html into distribution worktree.', -> + pkg = grunt.config('pkg') + grunt.file.copy "../#{pkg.meta.path}/test.html", 'index.html' + grunt.registerTask 'web', [ 'shell:markdown' 'pushd' + 'copy-web' 'shell:web' 'popd' ] diff --git a/Makefile b/Makefile index 5358050d2..ece5f44a6 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,12 @@ ifeq "$(OS)" "Windows_NT" BIN := $(subst /,\,node_modules/.bin/) RMDIR := -rmdir /s /q RM := -del + CP = mkdir $(subst /,\,$(dir $@)) & copy /y $(subst /,\,$<) $(subst /,\,$@) else BIN := node_modules/.bin/ RMDIR := rm -rf RM := rm -rf + CP = mkdir -p $(dir $@) && cp $< $@ endif coffee := $(BIN)coffee -c --no-header @@ -17,8 +19,6 @@ template_deps := \ package.json version.json \ tools/templates.coffee \ node_modules/coffee-script/package.json node_modules/fs-extra/package.json node_modules/lodash/package.json node_modules/glob/package.json -cp := node tools/cp.js -cp_deps := tools/cp.js node_modules/fs-extra/package.json cat := node tools/cat.js cat_deps := tools/cat.js node_modules/fs-extra/package.json jshint_deps := .jshintrc node_modules/jshint/package.json @@ -126,11 +126,11 @@ define rules_channel testbuilds/crx$1/script.js : src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $(cat_deps) $(cat) src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $$@ -testbuilds/crx$1/eventPage.js : tmp/eventPage.js $(cp_deps) - $(cp) $$< $$@ +testbuilds/crx$1/eventPage.js : tmp/eventPage.js + $$(CP) -testbuilds/crx$1/icon%.png : src/meta/icon%.png $(cp_deps) - $(cp) $$< $$@ +testbuilds/crx$1/icon%.png : src/meta/icon%.png + $$(CP) testbuilds/crx$1/manifest.json : src/meta/manifest.json $(template_deps) $(template) $$< $$@ type=crx channel=$1 @@ -158,11 +158,11 @@ $(eval $(call rules_channel,)) $(eval $(call rules_channel,-beta)) $(eval $(call rules_channel,-noupdate)) -testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip $(cp_deps) - $(cp) $< $@ +testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip + $(CP) -builds/% : testbuilds/% $(jshint) $(cp_deps) - $(cp) $< $@ +builds/% : testbuilds/% $(jshint) + $(CP) test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json node tools/markdown.js diff --git a/tools/cp.js b/tools/cp.js deleted file mode 100644 index fc751e2b8..000000000 --- a/tools/cp.js +++ /dev/null @@ -1,3 +0,0 @@ -var fs = require('fs-extra'); - -fs.copySync(process.argv[2], process.argv[3]);