Skip to content

Commit 41eec53

Browse files
authored
Version 1.0.1
Restore `push` / `pull` functionality to empty Cloudinary/local dir
2 parents c643c44 + 26eb9f5 commit 41eec53

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11

2-
1.0.0 / 2020-04-01
2+
1.0.1 / 2020-04-01
3+
=============
4+
5+
* Restore `push` / `pull` functionality to empty Cloudinary/local directory
6+
7+
1.0.0 / 2020-04-01
38
=============
49
* Clean up and refactor code
510

cloudinary_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.0"
1+
__version__ = "1.0.1"
22

33
import cloudinary
44

cloudinary_cli/modules/sync.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ def _get_out_of_sync_file_names(self, common_file_names):
8080

8181
def push(self):
8282
if not self._delete_unique_remote_files():
83-
logger.info("Aborting...")
84-
return False
83+
if not (self.force or confirm_action(
84+
f"Cloudinary folder `{abspath(self.remote_dir)}` is empty or does not exist. "
85+
"Continue? (y/N) ")):
86+
logger.info("Aborting...")
87+
return False
8588

8689
files_to_push = self.unique_local_file_names | self.out_of_sync_file_names
8790

@@ -142,8 +145,11 @@ def _delete_unique_remote_files(self):
142145

143146
def pull(self):
144147
if not self._delete_unique_local_files():
145-
logger.info("Aborting...")
146-
return False
148+
if not (self.force or confirm_action(
149+
f"Local directory `{abspath(self.local_dir)}` is empty or does not exist. "
150+
"Continue? (y/N) ")):
151+
logger.info("Aborting...")
152+
return False
147153

148154
if not (self.force or confirm_action(
149155
f"Running this command will delete {len(self.unique_local_file_names)} local files. "

0 commit comments

Comments
 (0)