mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Precompile CoffeeScript files
This commit is contained in:
parent
2085e71f33
commit
01d2edb819
1
.gitignore
vendored
1
.gitignore
vendored
@ -30,3 +30,4 @@ node_modules
|
||||
bin/node
|
||||
|
||||
build/
|
||||
release/
|
||||
|
@ -47,7 +47,7 @@ fi
|
||||
|
||||
# Support calling bin/resin from within bin/
|
||||
if [ `dirname $0` == '.' ]; then
|
||||
$NODE_PATH "../lib/resin.js" "$@"
|
||||
$NODE_PATH "../build/app.js" "$@"
|
||||
else
|
||||
$NODE_PATH "./lib/resin.js" "$@"
|
||||
$NODE_PATH "./build/app.js" "$@"
|
||||
fi
|
||||
|
@ -9,4 +9,4 @@ set NODE_PATH="%~dp0\node\node-win32-%ARCH%.exe"
|
||||
set NODE_PATH="node.exe"
|
||||
)
|
||||
|
||||
%NODE_PATH% "%~dp0\..\lib\resin.js" %*
|
||||
%NODE_PATH% "%~dp0\..\build\app.js" %*
|
||||
|
@ -33,7 +33,7 @@ gulp.task 'test', ->
|
||||
reporter: mochaNotifierReporter.decorate('landing')
|
||||
}))
|
||||
|
||||
gulp.task 'coffee', [ 'test', 'lint' ], ->
|
||||
gulp.task 'coffee', [ 'test', 'lint', 'json' ], ->
|
||||
gulp.src(OPTIONS.files.app)
|
||||
.pipe(coffee())
|
||||
.pipe(gulp.dest(OPTIONS.directories.build))
|
||||
@ -49,19 +49,11 @@ gulp.task 'lint', ->
|
||||
}))
|
||||
.pipe(coffeelint.reporter())
|
||||
|
||||
gulp.task 'release', [ 'coffee', 'json' ], ->
|
||||
mkdirp.sync('build/Release')
|
||||
gulp.src('')
|
||||
.pipe(shell "jx package app.js Release/#{packageJSON.name} -native", {
|
||||
cwd: path.join(process.cwd(), OPTIONS.directories.build)
|
||||
})
|
||||
|
||||
gulp.task 'build', [
|
||||
'lint'
|
||||
'test'
|
||||
'coffee'
|
||||
'man'
|
||||
]
|
||||
|
||||
gulp.task 'watch', [ 'test', 'lint' ], ->
|
||||
gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'test', 'lint' ])
|
||||
gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'coffee' ])
|
||||
gulp.watch([ OPTIONS.files.man ], [ 'man' ])
|
||||
|
@ -1,3 +0,0 @@
|
||||
// http://coffeescript.org/documentation/docs/register.html
|
||||
require('coffee-script/register');
|
||||
require('./app.coffee');
|
@ -32,19 +32,19 @@ function distribute() {
|
||||
print_banner "Copying necessary files"
|
||||
|
||||
# Copy all needed files
|
||||
mkdir -p build/$package
|
||||
mkdir -p release/$package
|
||||
|
||||
cp -rf bin build/$package
|
||||
cp -rf bin release/$package
|
||||
|
||||
# TODO: Omit bin/node in a better way
|
||||
rm -rf build/$package/bin/node
|
||||
rm -rf release/$package/bin/node
|
||||
|
||||
cp -rf lib build/$package
|
||||
cp -rf package.json build/$package
|
||||
cp -rf build release/$package
|
||||
cp -rf package.json release/$package
|
||||
|
||||
print_banner "Running npm install"
|
||||
|
||||
cd build/$package
|
||||
cd release/$package
|
||||
|
||||
RESIN_BUNDLE=$os npm install --production --force
|
||||
flatten-packages .
|
||||
@ -70,4 +70,4 @@ function distribute() {
|
||||
distribute "win32"
|
||||
# distribute "sunos"
|
||||
|
||||
tree build/distrib
|
||||
tree release/distrib
|
||||
|
Loading…
Reference in New Issue
Block a user