fix: allow dry-run install without root privileges
Some checks failed
CI/CD / Test (push) Successful in 2m53s
CI/CD / Build (amd64, darwin) (push) Has been cancelled
CI/CD / Build (amd64, linux) (push) Has been cancelled
CI/CD / Build (arm64, darwin) (push) Has been cancelled
CI/CD / Build (arm64, linux) (push) Has been cancelled
CI/CD / Lint (push) Has been cancelled
Some checks failed
CI/CD / Test (push) Successful in 2m53s
CI/CD / Build (amd64, darwin) (push) Has been cancelled
CI/CD / Build (amd64, linux) (push) Has been cancelled
CI/CD / Build (arm64, darwin) (push) Has been cancelled
CI/CD / Build (arm64, linux) (push) Has been cancelled
CI/CD / Lint (push) Has been cancelled
This commit is contained in:
Binary file not shown.
@@ -273,8 +273,8 @@ func (i *Installer) Status(ctx context.Context, instance string) (*ServiceStatus
|
|||||||
|
|
||||||
// validatePrerequisites checks system requirements
|
// validatePrerequisites checks system requirements
|
||||||
func (i *Installer) validatePrerequisites() error {
|
func (i *Installer) validatePrerequisites() error {
|
||||||
// Check root
|
// Check root (skip in dry-run mode)
|
||||||
if os.Getuid() != 0 {
|
if os.Getuid() != 0 && !i.dryRun {
|
||||||
return fmt.Errorf("installation requires root privileges (use sudo)")
|
return fmt.Errorf("installation requires root privileges (use sudo)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user