Skip to content

macOS swiftly-install.sh does not create config.json #136

Closed
@BrianHenryIE

Description

@BrianHenryIE
% swiftly                                                               

Error: Could not load swiftly's configuration file at /Users/brianhenry/Library/Application Support/swiftly/config.json due to
error: "Error Domain=NSCocoaErrorDomain Code=260 "The file “config.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/brianhenry/Library/Application Support/swiftly/config.json, NSUnderlyingError=0x600000cc4ab0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}".
To use swiftly, modify the configuration file to fix the issue or perform a clean installation.

if [ "$IS_MACOS" == "false" ]; then
JSON_OUT=$(cat <<EOF
{
"platform": {
"name": "$PLATFORM_NAME",
"nameFull": "$PLATFORM_NAME_FULL",
"namePretty": "$PLATFORM_NAME_PRETTY",
"architecture": $PLATFORM_ARCH
},
"installedToolchains": [],
"inUse": null
}
EOF
)
fi

if [ "$IS_MACOS" == "false" ]; then
echo "$JSON_OUT" > "$HOME_DIR/config.json"
fi

Removing the conditionals allows swiftly to run, but the config is mostly empty:

% cat "/Users/brianhenry/Library/Application Support/swiftly/config.json"

{
  "platform": {
    "name": "",
    "nameFull": "",
    "namePretty": "",
    "architecture": "aarch64"
  },
  "installedToolchains": [],
  "inUse": null
}

And installing doesn't work:

% swiftly install 5.9

Fetching the latest stable Swift 5.9 release...
Installing Swift 5.9.2
Swift 5.9.2 does not exist, exiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions