Skip to content

Commit

Permalink
Merge pull request #155 from simondeziel/mandatory-arg-for-lxd-snapcraft
Browse files Browse the repository at this point in the history
lxd-snapcraft: require specifying package name
  • Loading branch information
tomponline authored Apr 19, 2024
2 parents 6034829 + c31bb35 commit 6e31185
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lxd-snapcraft/lxd-snapcraft.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func main() {
log.SetFlags(0)
flagFilePath := flag.String("file", "snapcraft.yaml", "Path to snapcraft.yaml file")
flagPackageName := flag.String("package", "lxd", "Package name")
flagPackageName := flag.String("package", "", "Package name")
flagGetVersion := flag.Bool("get-version", false, "Get version of package and source commit hash for lxd part")
flagSetVersion := flag.String("set-version", "", "Set version of package")
flagSetSourceCommit := flag.String("set-source-commit", "", "Set source-commit hash for lxd part")
Expand All @@ -25,6 +25,10 @@ func main() {
log.Fatal(err)
}

if *flagPackageName == "" {
log.Fatal("Package name is required")
}

pkgVersion, pkgConfig := getVersionInfo(*flagPackageName, snapcraftConfig)

if *flagGetVersion {
Expand Down

0 comments on commit 6e31185

Please sign in to comment.