Fix incorrect spacing of commands
This commit is contained in:
parent
abcc91ecb9
commit
bb345ba8a2
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,3 +14,5 @@
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
.idea
|
||||
|
||||
pikman
|
@ -1,6 +1,6 @@
|
||||
package alpine
|
||||
|
||||
var PackageManager = "apx "
|
||||
var PackageManager = "apx"
|
||||
|
||||
var Commands = map[string]string{
|
||||
"autoremove": "--apk autoremove",
|
||||
|
@ -1,6 +1,6 @@
|
||||
package arch
|
||||
|
||||
var PackageManager = "apx "
|
||||
var PackageManager = "apx"
|
||||
|
||||
var Commands = map[string]string{
|
||||
"autoremove": "--aur autoremove",
|
||||
|
@ -1,6 +1,6 @@
|
||||
package fedora
|
||||
|
||||
var PackageManager = "apx "
|
||||
var PackageManager = "apx"
|
||||
|
||||
var Commands = map[string]string{
|
||||
"autoremove": "--dnf autoremove",
|
||||
|
@ -1,6 +1,6 @@
|
||||
package flatpak
|
||||
|
||||
var PackageManager = "flatpak "
|
||||
var PackageManager = "flatpak"
|
||||
|
||||
var Commands = map[string]string{
|
||||
"install": "install",
|
||||
|
10
main.go
10
main.go
@ -247,35 +247,35 @@ func getCommand(command string, osType OSType, containerName string, packageName
|
||||
case Arch:
|
||||
cmd, ok := arch.Commands[command]
|
||||
if ok {
|
||||
return arch.PackageManager + cmd + containerName + strings.Join(packageName, " "), nil
|
||||
return fmt.Sprintf("%s %s %s %s", arch.PackageManager, cmd, containerName, strings.Join(packageName, " ")), nil
|
||||
} else {
|
||||
return "", fmt.Errorf("%s: is not a valid command for Arch", command)
|
||||
}
|
||||
case Fedora:
|
||||
cmd, ok := fedora.Commands[command]
|
||||
if ok {
|
||||
return fedora.PackageManager + cmd + containerName + strings.Join(packageName, " "), nil
|
||||
return fmt.Sprintf("%s %s %s %s", fedora.PackageManager, cmd, containerName, strings.Join(packageName, " ")), nil
|
||||
} else {
|
||||
return "", fmt.Errorf("%s: is not a valid command for Fedora", command)
|
||||
}
|
||||
case Flatpak:
|
||||
cmd, ok := flatpak.Commands[command]
|
||||
if ok {
|
||||
return flatpak.PackageManager + cmd + strings.Join(packageName, " "), nil
|
||||
return fmt.Sprintf("%s %s %s", flatpak.PackageManager, cmd, strings.Join(packageName, " ")), nil
|
||||
} else {
|
||||
return "", fmt.Errorf("%s: is not a valid command for Flatpak", command)
|
||||
}
|
||||
case Alpine:
|
||||
cmd, ok := alpine.Commands[command]
|
||||
if ok {
|
||||
return alpine.PackageManager + cmd + containerName + strings.Join(packageName, " "), nil
|
||||
return fmt.Sprintf("%s %s %s %s", alpine.PackageManager, cmd, containerName, strings.Join(packageName, " ")), nil
|
||||
} else {
|
||||
return "", fmt.Errorf("%s: is not a valid command for Alpine", command)
|
||||
}
|
||||
case Ubuntu:
|
||||
cmd, ok := ubuntu.Commands[command]
|
||||
if ok {
|
||||
return ubuntu.PackageManager + cmd + strings.Join(packageName, " "), nil
|
||||
return fmt.Sprintf("%s %s %s", ubuntu.PackageManager, cmd, strings.Join(packageName, " ")), nil
|
||||
} else {
|
||||
return "", fmt.Errorf("%s: is not a valid command for Ubuntu", command)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ubuntu
|
||||
|
||||
var PackageManager = "sudo -S apt "
|
||||
var PackageManager = "sudo -S apt"
|
||||
|
||||
var Commands = map[string]string{
|
||||
"autoremove": "autoremove",
|
||||
|
Loading…
Reference in New Issue
Block a user