Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 248ae0b

Browse files
Removed fs-extra and fs-promise dependencies
1 parent 38e38e3 commit 248ae0b

File tree

8 files changed

+1147
-1166
lines changed

8 files changed

+1147
-1166
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ matrix:
4444
before_install:
4545
- gem install cocoapods
4646
- pod repo update
47-
script: npm run build-ios-bundle
47+
script: npm i && npm run build-ios-bundle
4848
- language: android
4949
os: linux
5050
env:
5151
- Webpack="Android"
5252
jdk: oraclejdk8
5353
before_install: nvm install 6.10.3
54-
script: npm run build-android-bundle
54+
script: npm i ../src && npm run build-android-bundle
5555
- stage: "Build"
5656
env:
5757
- BuildAndroid="25"
@@ -60,7 +60,7 @@ matrix:
6060
jdk: oraclejdk8
6161
before_install: nvm install 6.10.3
6262
script:
63-
- cd tns build android
63+
- tns build android
6464
- os: osx
6565
env:
6666
- BuildiOS="10.3"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ project.ext {
8888
```
8989

9090
## Usage
91-
92-
If you want a quickstart, [clone our demo app](https://github.com/EddyVerbruggen/nativescript-plugin-firebase-demo).
91+
If you want a quickstart, clone the repo, `cd src`, and `npm run demo.ios` or `npm run demo.android`.
9392

9493
### Start-up wiring
9594
We need to do some wiring when your app starts, so open `app.js` and add this before `application.start();`:

publish/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PACK_DIR=package;
55
publish() {
66
cd $PACK_DIR
77
echo 'Publishing to npm...'
8-
# npm publish *.tgz
8+
npm publish *.tgz
99
}
1010

1111
./pack.sh && publish

src/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@
8484
"homepage": "https://github.com/eddyverbruggen/nativescript-plugin-firebase",
8585
"readmeFilename": "README.md",
8686
"dependencies": {
87-
"fs-extra": "~2.1.0",
88-
"fs-promise": "~2.0.0",
8987
"nativescript-hook": "~0.2.0",
9088
"prompt-lite": "~0.1.0"
9189
},
Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fs = require('fs-extra'); // TODO try without extra (and remove dep)
1+
var fs = require('fs');
22
var path = require('path');
33

44
module.exports = function (logger, platformsData, projectData, hookArgs) {
@@ -9,21 +9,10 @@ module.exports = function (logger, platformsData, projectData, hookArgs) {
99
project = path.join(projectRoot, projectData.projectName);
1010

1111
return new Promise(function (resolve, reject) {
12-
if (platform === 'ios') {
13-
fs.exists(entitlementsFile, function (exists) {
14-
if (!exists) {
15-
// no need to make noise, this is a totally valid case
16-
resolve();
17-
} else {
18-
var dest = path.join(project, projectData.projectName + ".entitlements");
19-
fs.copy(entitlementsFile, dest, function (error) {
20-
if (error) return reject(error);
21-
resolve();
22-
});
23-
}
24-
})
25-
} else {
26-
resolve();
12+
if (platform === 'ios' && fs.existsSync(entitlementsFile)) {
13+
var dest = path.join(project, projectData.projectName + ".entitlements");
14+
fs.createReadStream(entitlementsFile).pipe(fs.createWriteStream(dest));
2715
}
16+
resolve();
2817
});
2918
};

src/scripts/entitlements-before-prepare.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fs = require('fs-extra'); // TODO try without extra (and remove dep)
1+
var fs = require('fs');
22
var path = require('path');
33

44
module.exports = function (logger, platformsData, projectData, hookArgs) {
@@ -8,23 +8,18 @@ module.exports = function (logger, platformsData, projectData, hookArgs) {
88
platformResourcesDirectory = path.join(appResourcesDirectoryPath, 'iOS');
99

1010
return new Promise(function (resolve, reject) {
11-
if (platform === 'ios') {
12-
fs.exists(entitlementsFile, function (exists) {
13-
if (!exists) {
14-
// no need to make noise, this is a totally valid case
15-
resolve();
16-
} else {
17-
var target = path.join(platformResourcesDirectory, 'build.xcconfig');
18-
try {
19-
var buildData = fs.readFileSync(target).toString();
20-
if (!buildData.toString().match(/^\s*CODE_SIGN_ENTITLEMENTS/mg)) {
21-
fs.appendFileSync(target, '\nCODE_SIGN_ENTITLEMENTS = ' + path.join(projectData.projectName, projectData.projectName + '.entitlements'));
22-
}
23-
} catch (error) {
24-
reject();
25-
}
11+
if (platform === 'ios' && fs.existsSync(entitlementsFile)) {
12+
var target = path.join(platformResourcesDirectory, 'build.xcconfig');
13+
try {
14+
var buildData = fs.readFileSync(target).toString();
15+
if (!buildData.toString().match(/^\s*CODE_SIGN_ENTITLEMENTS/mg)) {
16+
fs.appendFileSync(target, '\nCODE_SIGN_ENTITLEMENTS = ' + path.join(projectData.projectName, projectData.projectName + '.entitlements'));
2617
}
27-
});
18+
} catch (error) {
19+
reject();
20+
}
21+
} else {
22+
resolve();
2823
}
2924
resolve();
3025
});

0 commit comments

Comments
 (0)