Skip to content

Commit

Permalink
Rename --link to --symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
gvbr committed Jan 19, 2022
1 parent 2f3b1b4 commit cfaca14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Options:
-o,--output-dir=PATH If provided, ROMs will be copied to an output directory
Ex.: -o "C:\Users\John\Downloads\Emulators\SNES\ROMs\1G1R"
--move If set, ROMs will be moved, instead of copied, to the output directory
--link If set, ROMs will be symlinked (soft linked) to the output directory
--symlink If set, ROMs will be symlinked (soft linked) to the output directory
Please note newer versions of Windows 10 require elevated privileges to create symlinks
--group-by-first-letter If set, groups ROMs on the output directory in subfolders according to the first letter in their name
Expand Down
20 changes: 10 additions & 10 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def main(argv: List[str]):
'all-regions-with-lang',
'debug',
'move',
'link',
'symlink',
'chunk-size=',
'threads=',
'header-file=',
Expand Down Expand Up @@ -569,7 +569,7 @@ def main(argv: List[str]):
group_by_first_letter = False
language_weight = 3
move = False
link = False
symlink = False
global THREADS
global RULES
global MAX_FILE_SIZE
Expand Down Expand Up @@ -649,7 +649,7 @@ def main(argv: List[str]):
except OSError:
sys.exit(help_msg('invalid output DIR: %s' % output_dir))
move |= opt == '--move'
link |= opt == '--link'
symlink |= opt == '--symlink'
if opt == '--chunk-size':
CHUNK_SIZE = int(arg)
if opt == '--threads':
Expand Down Expand Up @@ -914,7 +914,7 @@ def include_candidate(x: GameEntry) -> bool:
rom_input_path,
rom_output_path,
move,
link)
symlink)
copied_files.add(rom_input_path)
else:
log(
Expand All @@ -936,9 +936,9 @@ def include_candidate(x: GameEntry) -> bool:
if full_path.is_file():
if curr_out_dir:
curr_out_dir.mkdir(parents=True, exist_ok=True)
if link:
if symlink:
curr_out_dir = curr_out_dir / file_name
transfer_file(full_path, curr_out_dir, move, link)
transfer_file(full_path, curr_out_dir, move, symlink)
else:
printed_items.append(file_name)
break
Expand All @@ -955,7 +955,7 @@ def include_candidate(x: GameEntry) -> bool:
rom_input_path,
rom_output_dir,
move,
link)
symlink)
shutil.copystat(
str(full_path),
str(rom_output_dir))
Expand Down Expand Up @@ -1047,12 +1047,12 @@ def transfer_file(
input_path: Path,
output_path: Path,
move: bool,
link: bool) -> None:
symlink: bool) -> None:
try:
if move:
print('Moving [%s] to [%s]' % (input_path, output_path))
shutil.move(str(input_path), str(output_path))
elif link:
elif symlink:
print('Linking [%s] to [%s]' % (input_path, output_path))
output_path.symlink_to(input_path.resolve())
else:
Expand Down Expand Up @@ -1107,7 +1107,7 @@ def help_msg(s: Optional[Union[str, Exception]] = None) -> str:
'If set, ROMs will be moved, instead of copied, '
'to the output directory',

'\t--link\t\t\t'
'\t--symlink\t\t'
'If set, ROMs will be symlinked (soft linked) '
'to the output directory'
'\n\t\t\t\t'
Expand Down

0 comments on commit cfaca14

Please sign in to comment.