Skip to content

fix Error: EEXIST: file already exists #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ install:
script:
- NODE_ENV=test npm run coveralls
after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
before_deploy:
- brew update
- brew install bower
Expand Down
28 changes: 27 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pipeline",
"description": "Be less busy, less mistake in Salesforce metadata deploy",
"version": "2.0.0",
"version": "2.0.1",
"private": false,
"main": "src/main.js",
"dependencies": {
Expand Down Expand Up @@ -64,6 +64,7 @@
"devDependencies": {
"app-builder-lib": "^20.43.0",
"chai": "^4.2.0",
"coveralls": "^3.0.4",
"electron": "3.1.9",
"electron-builder": "^20.43.0",
"electron-builder-squirrel-windows": "^20.43.0",
Expand Down
4 changes: 3 additions & 1 deletion src/class/Metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class Metadata {
const pipelinePath = path.join(userDataPath, 'pipeline', pid, 'metadata');
const filePath = path.join(pipelinePath, filename);
const filePathWithoutName = path.dirname(filePath);
fse.ensureDirSync(filePathWithoutName, '0777');
if(!fse.pathExistsSync(filePathWithoutName)) {
fse.ensureDirSync(filePathWithoutName, '0777');
}
return filePath
}

Expand Down
4 changes: 3 additions & 1 deletion src/class/SfdcApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,9 @@ class SfdcApi {
});
unzipper.on('extract', function (log) {
// console.log('[SFDC]Finished extracting' + log);
fse.ensureDirSync(sourceZipPath, '0777');
if(fse.pathExistsSync(sourceZipPath)) {
fse.removeSync(sourceZipPath);
}
return callback(null, true);
});
unzipper.extract({
Expand Down