swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

Don't auto-delete swiftly binary on `init`

Open Wilfred opened this issue 7 months ago • 1 comments

$ curl -O https://download.swift.org/swiftly/linux/swiftly-1.0.0-$(uname -m).tar.gz.sig
$ tar -xzf swiftly-1.0.0-x86_64.tar.gz

$ ./swiftly init
Swiftly will be installed into the following locations:

/home/wilfred/.local/share/swiftly - Data and configuration files directory including toolchains
/home/wilfred/.local/share/swiftly/bin - Executables installation directory

These locations can be changed with SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables and run this again.

Once swiftly is installed it will install the latest available swift toolchain. In the process of installing the new toolchain swiftly will add swift.org GnuPG keys into your keychain to verify the integrity of the downloads.

Proceed? (Y/n):

Installing swiftly in /home/wilfred/.local/share/swiftly/bin/swiftly...
Updating profile...
Fetching the latest stable Swift release...
Error: NIOConnectionError(host: "www.swift.org", ... truncated

$ export http_proxy=my_http_proxy:8080
$ ./swiftly init
zsh: no such file or directory: ./swiftly

It looks like swiftly unconditionally moves itself to ~/.local/share/swiftly/bin, which is surprising, especially when the init fails.

Could swiftly copy rather than move the binary?

Wilfred avatar May 16 '25 13:05 Wilfred

Thanks for raising this issue. The init subcommand could do better to be resilient to failure when running.

cmcgee1024 avatar May 21 '25 14:05 cmcgee1024