Merge pull request #48 from mlakewood/exclude_ds_store

Exclude ds store
This commit is contained in:
Artūr Girenko 2016-05-12 16:26:01 +02:00
commit b200b9e40c
2 changed files with 52 additions and 1 deletions

View File

@ -349,3 +349,49 @@ tools.
- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) - [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- [Xcode](https://developer.apple.com/xcode) (+ Command Line Tools) `>=6.3` (optional for Android) - [Xcode](https://developer.apple.com/xcode) (+ Command Line Tools) `>=6.3` (optional for Android)
- [OS X](http://www.apple.com/osx) `>=10.10` - [OS X](http://www.apple.com/osx) `>=10.10`
## Local Development
If you would like to run any of this on your local environment first clone the code to an appropriate place on your machine and install dependencies
```
$ git clone https://github.com/drapanjanas/re-natal.git
$ cd re-natal
$ npm install
```
To test any changes made to re-natal, cd to an already existing project or a brand new dummy project:
```
$ cd ../already-existing
```
and run the re-natal command line like so
```
$ node ../re-natal/index.js
Usage: re-natal [options] [command]
Commands:
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)
xcode open Xcode project
deps install all dependencies for the project
use-figwheel generate index.ios.js and index.android.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
use-ios-device <type> sets up the host for ios device type: 'simulator' - localhost, 'device' - auto detect IP on eth0, IP
use-component <name> configures a custom component to work with figwheel. name is the value you pass to (js/require) function.
enable-source-maps patches RN packager to server *.map files from filesystem, so that chrome can download them.
copy-figwheel-bridge copy figwheel-bridge.js into project
Options:
-h, --help output usage information
-V, --version output the version number
```
You can then run any of the commands manually.

View File

@ -216,15 +216,20 @@ scanImageDir = (dir) ->
fnames = fs.readdirSync(dir) fnames = fs.readdirSync(dir)
.map (fname) -> "#{dir}/#{fname}" .map (fname) -> "#{dir}/#{fname}"
.filter (path) -> fs.statSync(path).isFile() .filter (path) -> fs.statSync(path).isFile()
.filter (path) -> removeExcludeFiles(path)
.map (path) -> path.replace /@2x|@3x/i, '' .map (path) -> path.replace /@2x|@3x/i, ''
.filter (v, idx, slf) -> slf.indexOf(v) == idx .filter (v, idx, slf) -> slf.indexOf(v) == idx
dirs = fs.readdirSync(dir) dirs = fs.readdirSync(dir)
.map (fname) -> "#{dir}/#{fname}" .map (fname) -> "#{dir}/#{fname}"
.filter (path) -> fs.statSync(path).isDirectory() .filter (path) -> fs.statSync(path).isDirectory()
fnames.concat scanImages(dirs) fnames.concat scanImages(dirs)
removeExcludeFiles = (file) ->
excludedFileNames = [".DS_Store"]
res = excludedFileNames.map (ex) -> (file.indexOf ex) == -1
true in res
scanImages = (dirs) -> scanImages = (dirs) ->
imgs = [] imgs = []
for dir in dirs for dir in dirs