Warn empty app dir

This commit is contained in:
Cheng Zhao 2015-02-05 14:38:25 -08:00
parent a8b919f0e0
commit 505754783f

View File

@ -1,4 +1,5 @@
asar = require 'asar'
fs = require 'fs'
path = require 'path'
module.exports = (grunt) ->
@ -8,6 +9,10 @@ module.exports = (grunt) ->
done = @async()
appDir = grunt.config.get('atom.appDir')
unless fs.existsSync(appDir)
grunt.log.error 'The app has to be built before generating asar archive.'
return done(false)
asar.createPackage appDir, path.resolve(appDir, '..', 'app.asar'), (err) ->
return done(err) if err?
rm appDir