mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-04 13:36:35 +02:00
feat(cli): add ctrld diag for provisioning support
This commit is contained in:
@@ -175,6 +175,7 @@ func initCLI() *cobra.Command {
|
||||
InitClientsCmd(rootCmd)
|
||||
InitUpgradeCmd(rootCmd)
|
||||
InitLogCmd(rootCmd)
|
||||
InitDiagCmd(rootCmd)
|
||||
|
||||
return rootCmd
|
||||
}
|
||||
@@ -1381,6 +1382,17 @@ func userHomeDir() (string, error) {
|
||||
return ctrld.UserHomeDir()
|
||||
}
|
||||
|
||||
// serviceHomeDir returns the directory where a ctrld service with root or
|
||||
// administrator rights keeps its files. Unlike userHomeDir, it has no
|
||||
// fallback to the home directory of the current user, so a caller without
|
||||
// root that only reads looks where the service wrote.
|
||||
func serviceHomeDir() (string, error) {
|
||||
if isMobile() {
|
||||
return homedir, nil
|
||||
}
|
||||
return ctrld.ServiceHomeDir()
|
||||
}
|
||||
|
||||
// absHomeDir returns the absolute path of filename in the ctrld home
|
||||
// directory. A custom homedir wins, so a file lands next to the log and
|
||||
// the config that obey the same override.
|
||||
|
||||
Reference in New Issue
Block a user