()
| 35 | } |
| 36 | |
| 37 | func cmdInstallOptions() *lfs.FilterOptions { |
| 38 | requireGitVersion() |
| 39 | |
| 40 | if localInstall || worktreeInstall { |
| 41 | setupRepository() |
| 42 | } |
| 43 | |
| 44 | destArgs := 0 |
| 45 | if localInstall { |
| 46 | destArgs++ |
| 47 | } |
| 48 | if worktreeInstall { |
| 49 | destArgs++ |
| 50 | } |
| 51 | if systemInstall { |
| 52 | destArgs++ |
| 53 | } |
| 54 | if fileInstall != "" { |
| 55 | destArgs++ |
| 56 | } |
| 57 | |
| 58 | if destArgs > 1 { |
| 59 | Exit(tr.Tr.Get("Only one of the --local, --system, --worktree, and --file options can be specified.")) |
| 60 | } |
| 61 | |
| 62 | // This call will return -1 on Windows; don't warn about this there, |
| 63 | // since we can't detect it correctly. |
| 64 | uid := os.Geteuid() |
| 65 | if systemInstall && uid != 0 && uid != -1 { |
| 66 | Print(tr.Tr.Get("warning: current user is not root/admin, system install is likely to fail.")) |
| 67 | } |
| 68 | |
| 69 | return &lfs.FilterOptions{ |
| 70 | GitConfig: cfg.GitConfig(), |
| 71 | Force: forceInstall, |
| 72 | File: fileInstall, |
| 73 | Local: localInstall, |
| 74 | Worktree: worktreeInstall, |
| 75 | System: systemInstall, |
| 76 | SkipSmudge: skipSmudgeInstall, |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func installHooksCommand(cmd *cobra.Command, args []string) { |
| 81 | updateForce = forceInstall |
no test coverage detected