Skip to content

Commit 5dd28d2

Browse files
authored
Add support for Nushell env var settings
Currently, swiftly incorrectly generates Bash env var scripts when it is installed in Nushell.
1 parent bd68843 commit 5dd28d2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/Swiftly/Init.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ struct Init: SwiftlyCommand {
156156
set -x PATH "$SWIFTLY_BIN_DIR" $PATH
157157
end
158158
159+
"""
160+
} else shell.hasSuffix("/nu") {
161+
env = """
162+
$env.SWIFTLY_HOME_DIR = "\(Swiftly.currentPlatform.swiftlyHomeDir.path)"
163+
$env.SWIFTLY_BIN_DIR = "\(Swiftly.currentPlatform.swiftlyBinDir.path)"
164+
if "$SWIFTLY_BIN_DIR" not-in $env.PATH {
165+
$env.PATH = ($env.PATH | split row (char esep) | prepend $env.SWIFTLY_BIN_DIR)
166+
}
167+
159168
"""
160169
} else {
161170
env = """

0 commit comments

Comments
 (0)