mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-24 07:46:39 +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
|
bin/node
|
||||||
|
|
||||||
build/
|
build/
|
||||||
|
release/
|
||||||
|
@ -47,7 +47,7 @@ fi
|
|||||||
|
|
||||||
# Support calling bin/resin from within bin/
|
# Support calling bin/resin from within bin/
|
||||||
if [ `dirname $0` == '.' ]; then
|
if [ `dirname $0` == '.' ]; then
|
||||||
$NODE_PATH "../lib/resin.js" "$@"
|
$NODE_PATH "../build/app.js" "$@"
|
||||||
else
|
else
|
||||||
$NODE_PATH "./lib/resin.js" "$@"
|
$NODE_PATH "./build/app.js" "$@"
|
||||||
fi
|
fi
|
||||||
|
@ -9,4 +9,4 @@ set NODE_PATH="%~dp0\node\node-win32-%ARCH%.exe"
|
|||||||
set NODE_PATH="node.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')
|
reporter: mochaNotifierReporter.decorate('landing')
|
||||||
}))
|
}))
|
||||||
|
|
||||||
gulp.task 'coffee', [ 'test', 'lint' ], ->
|
gulp.task 'coffee', [ 'test', 'lint', 'json' ], ->
|
||||||
gulp.src(OPTIONS.files.app)
|
gulp.src(OPTIONS.files.app)
|
||||||
.pipe(coffee())
|
.pipe(coffee())
|
||||||
.pipe(gulp.dest(OPTIONS.directories.build))
|
.pipe(gulp.dest(OPTIONS.directories.build))
|
||||||
@ -49,19 +49,11 @@ gulp.task 'lint', ->
|
|||||||
}))
|
}))
|
||||||
.pipe(coffeelint.reporter())
|
.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', [
|
gulp.task 'build', [
|
||||||
'lint'
|
'coffee'
|
||||||
'test'
|
|
||||||
'man'
|
'man'
|
||||||
]
|
]
|
||||||
|
|
||||||
gulp.task 'watch', [ 'test', 'lint' ], ->
|
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' ])
|
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"
|
print_banner "Copying necessary files"
|
||||||
|
|
||||||
# Copy all needed 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
|
# 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 build release/$package
|
||||||
cp -rf package.json build/$package
|
cp -rf package.json release/$package
|
||||||
|
|
||||||
print_banner "Running npm install"
|
print_banner "Running npm install"
|
||||||
|
|
||||||
cd build/$package
|
cd release/$package
|
||||||
|
|
||||||
RESIN_BUNDLE=$os npm install --production --force
|
RESIN_BUNDLE=$os npm install --production --force
|
||||||
flatten-packages .
|
flatten-packages .
|
||||||
@ -70,4 +70,4 @@ function distribute() {
|
|||||||
distribute "win32"
|
distribute "win32"
|
||||||
# distribute "sunos"
|
# distribute "sunos"
|
||||||
|
|
||||||
tree build/distrib
|
tree release/distrib
|
||||||
|
Loading…
Reference in New Issue
Block a user