Skip to content

Commit ac82ef3

Browse files
authored
Merge pull request #19 from xgeek-net/fix/eexist_error
fix Error: EEXIST: file already exists
2 parents 6faa677 + 5cf6e5f commit ac82ef3

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ install:
3434
script:
3535
- NODE_ENV=test npm run coveralls
3636
after_success:
37-
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
37+
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
3838
before_deploy:
3939
- brew update
4040
- brew install bower

package-lock.json

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pipeline",
33
"description": "Be less busy, less mistake in Salesforce metadata deploy",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"private": false,
66
"main": "src/main.js",
77
"dependencies": {
@@ -64,6 +64,7 @@
6464
"devDependencies": {
6565
"app-builder-lib": "^20.43.0",
6666
"chai": "^4.2.0",
67+
"coveralls": "^3.0.4",
6768
"electron": "3.1.9",
6869
"electron-builder": "^20.43.0",
6970
"electron-builder-squirrel-windows": "^20.43.0",

src/class/Metadata.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class Metadata {
7171
const pipelinePath = path.join(userDataPath, 'pipeline', pid, 'metadata');
7272
const filePath = path.join(pipelinePath, filename);
7373
const filePathWithoutName = path.dirname(filePath);
74-
fse.ensureDirSync(filePathWithoutName, '0777');
74+
if(!fse.pathExistsSync(filePathWithoutName)) {
75+
fse.ensureDirSync(filePathWithoutName, '0777');
76+
}
7577
return filePath
7678
}
7779

src/class/SfdcApi.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,9 @@ class SfdcApi {
651651
});
652652
unzipper.on('extract', function (log) {
653653
// console.log('[SFDC]Finished extracting' + log);
654-
fse.ensureDirSync(sourceZipPath, '0777');
654+
if(fse.pathExistsSync(sourceZipPath)) {
655+
fse.removeSync(sourceZipPath);
656+
}
655657
return callback(null, true);
656658
});
657659
unzipper.extract({

0 commit comments

Comments
 (0)