Skip to content

Commit

Permalink
Merge branch 'master' of github.com:drapanjanas/re-natal
Browse files Browse the repository at this point in the history
  • Loading branch information
drapanjanas committed Dec 3, 2018
2 parents 0fe94c0 + 5f586a0 commit a35d03e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ Packager so try to avoid doing so.
- You can launch your app on the simulator without opening Xcode by running
`react-native run-ios` in your app's root directory (since RN 0.19.0).

- To change advanced settings run `re-natal xcode` to quickly open the Xcode project.
- To change advanced settings run `re-natal xcode` to quickly open the Xcode project. (A workspace
will be opened in preference to a project if present.)

- If you have customized project layout and `re-natal upgrade` does not fit you well,
then these commands might be useful for you:
Expand Down Expand Up @@ -450,7 +451,7 @@ $ node ../re-natal/index.js
init [options] <name> create a new ClojureScript React Native project
upgrade upgrades project files to current installed version of re-natal (the upgrade of re-natal itself is done via npm)
add-platform <platform> adds additional app platform: 'windows' - UWP app, 'wpf' - WPF app
xcode open Xcode project
xcode open Xcode project (or workspace if present)
deps install all dependencies for the project
use-figwheel generate index.*.js for development with figwheel
use-android-device <type> sets up the host for android device type: 'real' - localhost, 'avd' - 10.0.2.2, 'genymotion' - 10.0.3.2, IP
Expand Down
15 changes: 10 additions & 5 deletions re-natal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -690,17 +690,21 @@ addPlatform = (platform) ->
logErr message

openXcode = (name) ->
if fs.existsSync "ios/#{name}.xcworkspace"
openTarget = "#{name}.xcworkspace"
else
openTarget = "#{name}.xcodeproj"
try
exec "open ios/#{name}.xcodeproj"
exec "open ios/#{openTarget}"
catch {message}
logErr \
if message.match /ENOENT/i
"""
Cannot find #{name}.xcodeproj in ios.
Cannot find #{openTarget} in ios.
Run this command from your project's root directory.
"""
else if message.match /EACCES/i
"Invalid permissions for opening #{name}.xcodeproj in ios"
"Invalid permissions for opening #{openTarget} in ios"
else
message

Expand Down Expand Up @@ -733,7 +737,8 @@ extractRequiresFromSourceFile = (file) ->

buildRequireByPlatformMap = () ->
onlyUserCljs = (item) -> fpath.extname(item.path) == '.cljs' and
item.path.indexOf('/target/') < 0 # ignore target dir
item.path.indexOf('/target/') < 0 and # ignore target dir
item.path.indexOf('/re-natal/') < 0 # ignore re-natal internal cljs files (can happen if re-natal is installed as a devDependency)
files = klawSync process.cwd(),
nodir: true
filter: onlyUserCljs
Expand Down Expand Up @@ -955,7 +960,7 @@ cli.command 'add-platform <platform>'
addPlatform(platform)

cli.command 'xcode'
.description 'open Xcode project'
.description 'open Xcode project (or workspace if present)'
.action ->
ensureOSX ->
ensureXcode ->
Expand Down

0 comments on commit a35d03e

Please sign in to comment.