added task to open xcode project
This commit is contained in:
parent
5ea75044c5
commit
4af684c5b8
21
main.coffee
21
main.coffee
|
@ -196,7 +196,21 @@ init = (projName) ->
|
||||||
else
|
else
|
||||||
message
|
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'
|
cli.version '0.0.4'
|
||||||
|
@ -213,5 +227,10 @@ cli.command 'init <name>'
|
||||||
|
|
||||||
init name
|
init name
|
||||||
|
|
||||||
|
cli.command 'xcode'
|
||||||
|
.description 'Open Xcode project'
|
||||||
|
.action ->
|
||||||
|
openXcode readConfig().name
|
||||||
|
|
||||||
|
|
||||||
cli.parse process.argv
|
cli.parse process.argv
|
||||||
|
|
Loading…
Reference in New Issue