提交 2c621abd 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Fix the args requires

上级 64705cdc
package cmd
import (
"errors"
"fmt"
"io/ioutil"
"log"
......@@ -26,22 +25,16 @@ var configOptions ConfigOptions
func init() {
rootCmd.AddCommand(configCmd)
configCmd.PersistentFlags().StringVarP(&configOptions.Current, "current", "c", "", "Set the current Jenkins")
configCmd.PersistentFlags().BoolVarP(&configOptions.Show, "show", "s", false, "Show the current Jenkins")
configCmd.PersistentFlags().BoolVarP(&configOptions.Generate, "generate", "g", false, "Generate a sample config file for you")
configCmd.PersistentFlags().BoolVarP(&configOptions.List, "list", "l", false, "Display all your Jenkins configs")
configCmd.Flags().StringVarP(&configOptions.Current, "current", "c", "", "Set the current Jenkins")
configCmd.Flags().BoolVarP(&configOptions.Show, "show", "s", false, "Show the current Jenkins")
configCmd.Flags().BoolVarP(&configOptions.Generate, "generate", "g", false, "Generate a sample config file for you")
configCmd.Flags().BoolVarP(&configOptions.List, "list", "l", false, "Display all your Jenkins configs")
}
var configCmd = &cobra.Command{
Use: "config",
Short: "Manage the config of jcli",
Long: `Manage the config of jcli`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("requires at least one argument")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) {
current := getCurrentJenkins()
if configOptions.Show {
......
#!/bin/sh
VERSION=$(hub tag --list | tail -n 1)
VERSION_BITS=(${VERSION//./ })
VNUM1=${VERSION_BITS[0]}
VNUM2=${VERSION_BITS[1]}
VNUM3=${VERSION_BITS[2]}
VNUM3=$((VNUM3+1))
NEW_TAG="$VNUM1.$VNUM2.$VNUM3"
echo "Updating $VERSION to $NEW_TAG"
#get current hash and see if it already has a tag
GIT_COMMIT=`git rev-parse HEAD`
NEEDS_TAG=`git describe --contains $GIT_COMMIT`
if [[ -z "${NEEDS_TAG}" ]]; then
echo "hub release create -c -a release/jcli-darwin-amd64.tar.gz v${NEW_TAG}"
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册