added task to open xcode project

This commit is contained in:
Dan Motzenbecker 2015-09-19 14:47:28 -04:00
parent 5ea75044c5
commit 4af684c5b8
1 changed files with 20 additions and 1 deletions

View File

@ -196,7 +196,21 @@ init = (projName) ->
else
message
process.exit 1
openXcode = (name) ->
try
execSync "open iOS/iOS/#{name}.xcworkspace", stdio: 'ignore'
catch {message}
logErr \
if message.match /ENOENT/i
"""
Cannot find #{name}.xcworkspace in iOS/iOS.
Run this command from your project's root directory.
"""
else if message.match /EACCES/i
"Invalid permissions for opening #{name}.xcworkspace in iOS/iOS"
else
message
cli.version '0.0.4'
@ -213,5 +227,10 @@ cli.command 'init <name>'
init name
cli.command 'xcode'
.description 'Open Xcode project'
.action ->
openXcode readConfig().name
cli.parse process.argv