Skip to content

--directory doesn't work #303

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

Open
chipitsine opened this issue Jul 1, 2023 · 2 comments · May be fixed by #422
Open

--directory doesn't work #303

chipitsine opened this issue Jul 1, 2023 · 2 comments · May be fixed by #422

Comments

@chipitsine
Copy link

Mac-2748:~ runner$ xcodes download 14.2.0 --directory=xc

Downloading with aria2 (/usr/local/bin/aria2c)
(1/1) Downloading Xcode 14.2.0+14C18: 99%

Xcode 14.2.0 has been downloaded to /Users/runner/Downloads/Xcode-14.2.0+14C18.xip
Mac-2748:~ runner$ ls xc
Mac-2748:~ runner$ rm Downloads/Xcode-14.2.0+14C18.xip 
Mac-2748:~ runner$ xcodes download 14.2.0 --directory xc

Downloading with aria2 (/usr/local/bin/aria2c)
(1/1) Downloading Xcode 14.2.0+14C18: 99%

Xcode 14.2.0 has been downloaded to /Users/runner/Downloads/Xcode-14.2.0+14C18.xip
Mac-2748:~ runner$ 

file is stored in Downloads despite explicit --directory specified

@mcaulifn
Copy link

Are there any updates on this one?

pyrtsa added a commit to pyrtsa/xcodes that referenced this issue Apr 11, 2025
@pyrtsa pyrtsa linked a pull request Apr 11, 2025 that will close this issue
@pyrtsa
Copy link

pyrtsa commented Apr 11, 2025

There's a simple fix in #422.

Looks like the --directory option required an absolute path to date and silently failed, falling back to $XCODES_DIRECTORY or ~/Downloads if the value wasn't an absolute path to an existing directory.

The fix is explained in the README of mxcl/Path.swift:

// paths are *always* absolute thus avoiding common bugs
let path = Path(userInput) ?? Path.cwd/userInput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants