in fast-build-update-tool/internal/config/cli_args.go [104:139]
func (c *CLIArgs) Validate() (err error) {
if c.FleetId == "" {
err = errors.Join(err, missingArgumentError(argFleetId))
}
if c.IpRange == "" {
err = errors.Join(err, missingArgumentError(argIpRange))
} else if !isValidIpRange(c.IpRange) {
err = errors.Join(err, invalidArgumentError(argIpRange, "must be a valid IP range"))
}
// We do not need to validate a build zip file if we are just restarting the process
if c.RestartProcess {
if c.BuildZipPath != "" {
err = errors.Join(err, invalidArgumentError(argBuildZipPath, "zip file provided along with restart process flag"))
}
} else {
if c.BuildZipPath == "" {
err = errors.Join(err, missingArgumentError(argBuildZipPath))
} else if !doesFileExist(c.BuildZipPath) {
err = errors.Join(err, missingFileError(argBuildZipPath))
}
}
if c.PrivateKeyPath == "" {
err = errors.Join(err, missingArgumentError(argPrivateKey))
} else if !doesFileExist(c.PrivateKeyPath) {
err = errors.Join(err, missingFileError(argPrivateKey))
}
return err
}