I built the repo and replaced DOWNLOAD_URL in swiftly-install.sh with the build I made.
The UI displays $HOME/Library/Application where it should show $HOME/Library/Application Support/swiftly
% ./swiftly-install.sh
This script will install swiftly, a Swift toolchain installer and manager.
Current installation options:
Data and configuration files directory: $HOME/Library/Application
Executables installation directory: $HOME/Library/Application
Modify login config ($HOME/.zprofile): true
Install system dependencies: true
Select one of the following:
1) Proceed with the installation (default)
2) Customize the installation
3) Cancel
> 1
Downloading swiftly from https://brianhenryie.s3.amazonaws.com/2024/swiftly...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 18.7M 100 18.7M 0 0 5497k 0 0:00:03 0:00:03 --:--:-- 5499k
swiftly has been successfully installed!
Once you log in again, swiftly should be accessible from your PATH.
To begin using swiftly from your current shell, first run the following command:
. $HOME/Library/Application/env.sh
Then to install the latest version of Swift, run 'swiftly install latest'
Warning: existing installation of Swift detected at /usr/bin/swift
To ensure swiftly-installed toolchains can be found by the shell, uninstall any existing Swift installation(s).
To ensure the current shell can find swiftly-installed toolchains, you may also need to run 'hash -r'.
When I open a new Terminal shell
/Users/brianhenry/.zprofile:.:9: no such file or directory: /Users/brianhenry/Library/Application/env.sh
and
% swiftly
zsh: command not found: swiftly
The binary was correctly installed
% ls $HOME/Library/Application\ Support/swiftly/bin/
swiftly
but the env.sh file seems to have escaping problems
cat $HOME/Library/Application\ Support/swiftly/env.sh
export SWIFTLY_HOME_DIR="$HOME/Library/Application"
export SWIFTLY_BIN_DIR="$HOME/Library/Application"
if [[ ":$PATH:" != *":$SWIFTLY_BIN_DIR:"* ]]; then
export PATH="$SWIFTLY_BIN_DIR:$PATH"
fi
I built the repo and replaced
DOWNLOAD_URL
inswiftly-install.sh
with the build I made.The UI displays
$HOME/Library/Application
where it should show$HOME/Library/Application Support/swiftly
When I open a new Terminal shell
and
The binary was correctly installed
but the
env.sh
file seems to have escaping problemsThe problem is in the
replace_home_path
function: https://github.com/swiftlang/swiftly/blob/bcfd8439a078893c11d3331c193e2b6a7b431887/install/swiftly-install.sh#L94-L103which I think can be fixed with:
And also use
$@
in thebold
function: https://github.com/swiftlang/swiftly/blob/bcfd8439a078893c11d3331c193e2b6a7b431887/install/swiftly-install.sh#L112-L115Then the path put into the
source
command needs to be quoted: https://github.com/swiftlang/swiftly/blob/bcfd8439a078893c11d3331c193e2b6a7b431887/install/swiftly-install.sh#L651I'll put together a PR with those changes now, but I don't know what, if any, impact it will have when run under Linux.