Переглянути джерело

Added help when err != nil.

Steve Thielemann 2 тижнів тому
батько
коміт
448a851af1
2 змінених файлів з 6 додано та 3 видалено
  1. 4 1
      aptgrade.go
  2. 2 2
      install.sh

+ 4 - 1
aptgrade.go

@@ -10,7 +10,7 @@ import (
 
 // Run the given command, showing output.
 func run_command(command []string) error {
-	fmt.Println(strings.Repeat("=", 50))
+	fmt.Println(strings.Repeat("=", 64))
 	fmt.Println(command)
 	cmd := exec.Command(command[0], command[1:]...)
 	// Connections
@@ -23,6 +23,9 @@ func run_command(command []string) error {
 	err := cmd.Run()
 	fmt.Println(strings.Repeat("=", 50))
 	if err != nil {
+		fmt.Println("Did you forget to:")
+		fmt.Println("  sudo chown root:root aptgrade")
+		fmt.Println("  sudo chmod a+s aptgrade")
 		fmt.Println("Command failed:", err)
 	}
 	return err

+ 2 - 2
install.sh

@@ -2,5 +2,5 @@
 
 sudo rm -rf ~thor/bin/aptgrade
 cp ./aptgrade ~thor/bin
-chown root:root ~thor/bin/aptgrade
-chmod a+s ~thor/bin/aptgrade
+sudo chown root:root ~thor/bin/aptgrade
+sudo chmod a+s ~thor/bin/aptgrade