Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70fff01

Browse files
committed
Get base dir from env
1 parent fe3bea1 commit 70fff01

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

util/unzipper.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@
1010
# (so multiple versions of the same java Class can co-exist, qualified by the lecture/project they appeared in)
1111
# for unduly nested zips, flatten / after files are moved remove orphaned directories
1212

13-
source_path_name = '/Users/robw/learn-master/udemy/java8-complete-reorg/zips/'
13+
home_dir = os.environ['HOME']
14+
source_path_name = home_dir + '/learn-master/udemy/java8-complete-reorg/zips/'
15+
target_path_name = home_dir + '/learn-master/udemy/java8-complete-reorg/lectures/'
16+
17+
if not (os.path.isdir(source_path_name) and os.path.isdir(target_path_name)):
18+
print('One or more invalid input directories: ')
19+
print('\t' + source_path_name)
20+
print('\t' + target_path_name)
21+
exit(1)
1422

15-
target_path_name = '/Users/robw/learn-master/udemy/java8-complete-reorg/lectures/'
1623

1724
source_path = Path(source_path_name)
1825

0 commit comments

Comments
 (0)