2014-06-03 15:08:58 +00:00
|
|
|
package commands
|
2014-03-19 18:08:38 +00:00
|
|
|
|
|
|
|
import (
|
2015-11-16 20:31:26 +00:00
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2016-05-23 18:02:27 +00:00
|
|
|
"github.com/spf13/cobra"
|
2014-03-19 18:08:38 +00:00
|
|
|
)
|
|
|
|
|
2015-11-16 23:40:33 +00:00
|
|
|
// TODO: Remove for Git LFS v2.0 https://github.com/github/git-lfs/issues/839
|
2014-06-26 21:32:32 +00:00
|
|
|
func initCommand(cmd *cobra.Command, args []string) {
|
2015-11-16 20:31:26 +00:00
|
|
|
fmt.Fprintf(os.Stderr, "WARNING: 'git lfs init' is deprecated. Use 'git lfs install' now.\n")
|
|
|
|
installCommand(cmd, args)
|
2014-06-03 20:41:48 +00:00
|
|
|
}
|
2014-03-19 18:08:38 +00:00
|
|
|
|
2014-06-26 21:32:32 +00:00
|
|
|
func initHooksCommand(cmd *cobra.Command, args []string) {
|
2015-11-16 20:31:26 +00:00
|
|
|
fmt.Fprintf(os.Stderr, "WARNING: 'git lfs init' is deprecated. Use 'git lfs install' now.\n")
|
|
|
|
installHooksCommand(cmd, args)
|
2014-06-03 20:41:48 +00:00
|
|
|
}
|
|
|
|
|
2014-03-19 18:08:38 +00:00
|
|
|
func init() {
|
2016-09-01 16:09:38 +00:00
|
|
|
RegisterCommand("init", initCommand, func(cmd *cobra.Command) {
|
2016-08-10 15:33:25 +00:00
|
|
|
cmd.Flags().BoolVarP(&forceInstall, "force", "f", false, "Set the Git LFS global config, overwriting previous values.")
|
|
|
|
cmd.Flags().BoolVarP(&localInstall, "local", "l", false, "Set the Git LFS config for the local Git repository only.")
|
|
|
|
cmd.Flags().BoolVarP(&skipSmudgeInstall, "skip-smudge", "s", false, "Skip automatic downloading of objects on clone or pull.")
|
2016-09-01 14:46:26 +00:00
|
|
|
cmd.AddCommand(NewCommand("hooks", initHooksCommand))
|
2016-08-10 15:33:25 +00:00
|
|
|
})
|
2014-03-19 18:08:38 +00:00
|
|
|
}
|