Replace cp.js by shell commands.
This commit is contained in:
parent
4a2d96b61a
commit
fe02be69b5
@ -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'
|
||||
]
|
||||
|
||||
20
Makefile
20
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
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
var fs = require('fs-extra');
|
||||
|
||||
fs.copySync(process.argv[2], process.argv[3]);
|
||||
Loading…
x
Reference in New Issue
Block a user