@@ -690,17 +690,21 @@ addPlatform = (platform) ->
690690 logErr message
691691
692692openXcode = (name ) ->
693+ if fs .existsSync " ios/#{ name} .xcworkspace"
694+ openTarget = " #{ name} .xcworkspace"
695+ else
696+ openTarget = " #{ name} .xcodeproj"
693697 try
694- exec " open ios/#{ name } .xcodeproj "
698+ exec " open ios/#{ openTarget } "
695699 catch {message}
696700 logErr \
697701 if message .match / ENOENT/ i
698702 """
699- Cannot find #{ name } .xcodeproj in ios.
703+ Cannot find #{ openTarget } in ios.
700704 Run this command from your project's root directory.
701705 """
702706 else if message .match / EACCES/ i
703- " Invalid permissions for opening #{ name } .xcodeproj in ios"
707+ " Invalid permissions for opening #{ openTarget } in ios"
704708 else
705709 message
706710
@@ -733,7 +737,8 @@ extractRequiresFromSourceFile = (file) ->
733737
734738buildRequireByPlatformMap = () ->
735739 onlyUserCljs = (item ) -> fpath .extname (item .path ) == ' .cljs' and
736- item .path .indexOf (' /target/' ) < 0 # ignore target dir
740+ item .path .indexOf (' /target/' ) < 0 and # ignore target dir
741+ item .path .indexOf (' /re-natal/' ) < 0 # ignore re-natal internal cljs files (can happen if re-natal is installed as a devDependency)
737742 files = klawSync process .cwd (),
738743 nodir : true
739744 filter : onlyUserCljs
@@ -955,7 +960,7 @@ cli.command 'add-platform <platform>'
955960 addPlatform (platform)
956961
957962cli .command ' xcode'
958- .description ' open Xcode project'
963+ .description ' open Xcode project (or workspace if present) '
959964 .action ->
960965 ensureOSX ->
961966 ensureXcode ->
0 commit comments