Skip to content

Commit

Permalink
Fix #890
Browse files Browse the repository at this point in the history
  • Loading branch information
icetee committed Jul 7, 2017
1 parent cfe252b commit 8d0a78c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/connectors/ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,19 @@ export default (function INIT() {

if (self.isConnected()) {
self.ftp.list(path, false, (listErr, list) => {
const files = list.filter(o => o.type === 'f');

// File exists
if (typeof list !== 'undefined' && files.length !== 0) {
if (enableTransfer) {
atom.notifications.addWarning('The file already exists.', {
detail: `${path} has already on the server!`,
});
if (typeof list !== 'undefined') {
const files = list.filter(o => o.type === '-');

// File exists
if (files.length !== 0) {
if (enableTransfer) {
atom.notifications.addWarning('The file already exists.', {
detail: `${path} has already on the server!`,
});
}
tryApply(completed, null, [listErr]);
return;
}
tryApply(completed, null, [listErr]);
return;
}

self.ftp.put(empty, path, (putErr) => {
Expand Down

0 comments on commit 8d0a78c

Please sign in to comment.