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('&&')
|
""".split('\n').join('&&')
|
||||||
web:
|
web:
|
||||||
command: """
|
command: """
|
||||||
node ../<%= pkg.meta.path %>/tools/cp.js ../<%= pkg.meta.path %>/test.html index.html
|
|
||||||
git merge --no-commit -s ours master
|
git merge --no-commit -s ours master
|
||||||
git checkout master README.md web.css img
|
git checkout master README.md web.css img
|
||||||
git commit -am "Update web page."
|
git commit -am "Update web page."
|
||||||
@ -176,9 +175,14 @@ module.exports = (grunt) ->
|
|||||||
'popd'
|
'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', [
|
grunt.registerTask 'web', [
|
||||||
'shell:markdown'
|
'shell:markdown'
|
||||||
'pushd'
|
'pushd'
|
||||||
|
'copy-web'
|
||||||
'shell:web'
|
'shell:web'
|
||||||
'popd'
|
'popd'
|
||||||
]
|
]
|
||||||
|
|||||||
20
Makefile
20
Makefile
@ -4,10 +4,12 @@ ifeq "$(OS)" "Windows_NT"
|
|||||||
BIN := $(subst /,\,node_modules/.bin/)
|
BIN := $(subst /,\,node_modules/.bin/)
|
||||||
RMDIR := -rmdir /s /q
|
RMDIR := -rmdir /s /q
|
||||||
RM := -del
|
RM := -del
|
||||||
|
CP = mkdir $(subst /,\,$(dir $@)) & copy /y $(subst /,\,$<) $(subst /,\,$@)
|
||||||
else
|
else
|
||||||
BIN := node_modules/.bin/
|
BIN := node_modules/.bin/
|
||||||
RMDIR := rm -rf
|
RMDIR := rm -rf
|
||||||
RM := rm -rf
|
RM := rm -rf
|
||||||
|
CP = mkdir -p $(dir $@) && cp $< $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
coffee := $(BIN)coffee -c --no-header
|
coffee := $(BIN)coffee -c --no-header
|
||||||
@ -17,8 +19,6 @@ template_deps := \
|
|||||||
package.json version.json \
|
package.json version.json \
|
||||||
tools/templates.coffee \
|
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
|
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 := node tools/cat.js
|
||||||
cat_deps := tools/cat.js node_modules/fs-extra/package.json
|
cat_deps := tools/cat.js node_modules/fs-extra/package.json
|
||||||
jshint_deps := .jshintrc node_modules/jshint/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)
|
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 $$@
|
$(cat) src/meta/botproc.js LICENSE src/meta/usestrict.js tmp/script-crx.js $$@
|
||||||
|
|
||||||
testbuilds/crx$1/eventPage.js : tmp/eventPage.js $(cp_deps)
|
testbuilds/crx$1/eventPage.js : tmp/eventPage.js
|
||||||
$(cp) $$< $$@
|
$$(CP)
|
||||||
|
|
||||||
testbuilds/crx$1/icon%.png : src/meta/icon%.png $(cp_deps)
|
testbuilds/crx$1/icon%.png : src/meta/icon%.png
|
||||||
$(cp) $$< $$@
|
$$(CP)
|
||||||
|
|
||||||
testbuilds/crx$1/manifest.json : src/meta/manifest.json $(template_deps)
|
testbuilds/crx$1/manifest.json : src/meta/manifest.json $(template_deps)
|
||||||
$(template) $$< $$@ type=crx channel=$1
|
$(template) $$< $$@ type=crx channel=$1
|
||||||
@ -158,11 +158,11 @@ $(eval $(call rules_channel,))
|
|||||||
$(eval $(call rules_channel,-beta))
|
$(eval $(call rules_channel,-beta))
|
||||||
$(eval $(call rules_channel,-noupdate))
|
$(eval $(call rules_channel,-noupdate))
|
||||||
|
|
||||||
testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip $(cp_deps)
|
testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
|
||||||
$(cp) $< $@
|
$(CP)
|
||||||
|
|
||||||
builds/% : testbuilds/% $(jshint) $(cp_deps)
|
builds/% : testbuilds/% $(jshint)
|
||||||
$(cp) $< $@
|
$(CP)
|
||||||
|
|
||||||
test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json
|
test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash/package.json
|
||||||
node tools/markdown.js
|
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