Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
better error handling for builder and run
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Frank committed Apr 23, 2012
1 parent 4ace459 commit 9bed256
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/command.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ app.commands.run = () ->

sdk.installed app, version, (err, builds) ->
if err then return app.log.error err

if builds.length == 0
app.log.error """
No valid SDK version matching input: #{version}.
"""
app.log.info "usage: tsm run (versio) (args*)"
return

path = path.join builds.pop().path, 'titanium.py'

tiargs.unshift path
Expand All @@ -113,12 +121,25 @@ app.commands.run = () ->
app.commands.builder = () ->
cb = [].pop.call arguments
version = arguments[0]
osname = arguments[1]
osname = arguments[1]
tiargs = (process.argv.slice 5)
version = String(version)

if osname not in ['iphone', 'android']
app.log.error "Invalid os: #{osname}"
app.log.info "usage: tsm builder (version) (osname) (args*)"
return

sdk.installed app, version, (err, builds) ->
if err then return app.log.error err

if builds.length == 0
app.log.error """
No valid SDK version matching input: #{version}.
"""
app.log.info "usage: tsm builder (version) (osname) (args*)"
return

path = path.join builds.pop().path, osname, 'builder.py'

tiargs.unshift path
Expand Down

0 comments on commit 9bed256

Please sign in to comment.