Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~ not expanded to home directory #1405

Open
dirn opened this issue Jan 2, 2025 · 2 comments
Open

~ not expanded to home directory #1405

dirn opened this issue Jan 2, 2025 · 2 comments
Labels
potential-bug A potential issue that needs confirmation and/or triage

Comments

@dirn
Copy link

dirn commented Jan 2, 2025

Paste the command

igir link test --symlink --overwrite --dat=$DAT_PATH/ --input=$BACKUPS/OSCR/ --output=~/ROMs/{es}/

Describe the bug

A directory called ~ was created inside my current working directory. Once created, deleting the folder is potentially dangerous. A user could try

rm -rf ~

and expect it to delete the ~ inside their current working directory. ~, however, will be expanding to the user's home directory and start deleting that.

Expected behavior

I expected files to be linked inside the ROMs folder inside my home directory.

Debug logs

Most of the output is from all of the candidates in the no-intro dat zip, but here's a relevant line

[14:29:35.407] INFO:  CandidateWriter: Nintendo - Nintendo Entertainment System (Headered): Ninja Gaiden (USA): creating symlink '/Users/dirn/Backups/OSCR/nes/Ninja Gaiden (USA).nes' →
'~/ROMs/nes/Ninja Gaiden (USA).nes'

DAT(s) used

No response

igir version

3.0.1

Node.js version

N.A

Operating system

macOS 15.2

Additional context

No response

@dirn dirn added the potential-bug A potential issue that needs confirmation and/or triage label Jan 2, 2025
@emmercm
Copy link
Owner

emmercm commented Jan 2, 2025

It's the responsibility of the CLI shell to expand ~ (among other expansions such as globbing). Try supplying options without the =, such as --output ~/ROMs/{es}/.

@dirn
Copy link
Author

dirn commented Jan 4, 2025

The shell expands it without the =. (I've also updated all of my scripts to use $HOME instead.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential-bug A potential issue that needs confirmation and/or triage
Projects
None yet
Development

No branches or pull requests

2 participants