-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_bin_dir.py
More file actions
executable file
·39 lines (27 loc) · 866 Bytes
/
setup_bin_dir.py
File metadata and controls
executable file
·39 lines (27 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/python3
import sys;
import os;
from pathlib import Path
from shutil import copytree
from shutil import copy
from shutil import rmtree
# Variables
OUTPUT_DIR = "Hangman_in_GTK"
RESOURCES_DIR = "resources"
binFullPath = sys.argv[ 1 ];
dirFullPathSplit = binFullPath.split( '/' );
#binName = dirFullPathSplit[ len( dirFullPathSplit ) - 1 ];
dirFullPathSplit.pop( len( dirFullPathSplit ) - 1 );
dirFullPath = '/'.join( dirFullPathSplit );
# Variables
# Check
if not os.path.exists( binFullPath ):
exit()
# Check
# IO stuff
if ( os.path.exists( dirFullPath + "/" + OUTPUT_DIR ) ):
rmtree( dirFullPath + "/" + OUTPUT_DIR );
Path( dirFullPath + "/" + OUTPUT_DIR ).mkdir( parents=True, exist_ok=True );
copytree( RESOURCES_DIR, dirFullPath + "/" + OUTPUT_DIR + "/" + RESOURCES_DIR );
copy( binFullPath, dirFullPath + "/" + OUTPUT_DIR );
# IO stuff