Skip to content

Commit

Permalink
fix:[#384] disallow updating built-in stacks
Browse files Browse the repository at this point in the history
- throw error if stack is built-in
- add english translation for update built-in stack error
  • Loading branch information
jardon committed Oct 16, 2024
1 parent 32b3a31 commit 9aef6f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ func updateStack(cmd *cobra.Command, args []string) error {
return error
}

if stack.BuiltIn {
cmdr.Error.Println(apx.Trans("stacks.update.error.builtIn"))
os.Exit(126)
}

if base == "" {
if !assumeYes {
cmdr.Info.Printfln(apx.Trans("stacks.update.info.askBase"), stack.Base)
Expand Down
1 change: 1 addition & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ stacks:
noPkgManager: "No package manager specified."
pkgManagerDoesNotExist: "The specified package manager does not exist. Create
it with 'apx pkgmanagers new' or contact the system administrator."
builtIn: "Built-in stacks cannot be modified."
info:
askBase: "Type a new base or confirm the current one (%s):"
askPkgManager: "Choose a new package manager or confirm the current one (%s):"
Expand Down

0 comments on commit 9aef6f1

Please sign in to comment.