Compare commits
	
		
			No commits in common. "2824ee4c62c77678eb55d025c85a3202db64588f" and "693e61d7d4e57be0b156fae980f3774a3fadaf6d" have entirely different histories.
		
	
	
		
			2824ee4c62
			...
			693e61d7d4
		
	
		
| @ -3,7 +3,6 @@ package manager | |||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"os" |  | ||||||
| 	"os/exec" | 	"os/exec" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
| 	"strings" | 	"strings" | ||||||
| @ -122,12 +121,7 @@ func getSystemSrvs() ([]string, error) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func getUserSrvs(home string) ([]string, error) { | func getUserSrvs(home string) ([]string, error) { | ||||||
| 	confDir := filepath.Join(home, srvUserPath) | 	return getSrvs(filepath.Join(home, srvUserPath)) | ||||||
| 	err := os.MkdirAll(confDir, 0755) |  | ||||||
| 	if nil != err { |  | ||||||
| 		return nil, err |  | ||||||
| 	} |  | ||||||
| 	return getSrvs(confDir) |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // "come.example.foo.plist" matches "foo" | // "come.example.foo.plist" matches "foo" | ||||||
|  | |||||||
| @ -1,32 +0,0 @@ | |||||||
| package manager |  | ||||||
| 
 |  | ||||||
| import ( |  | ||||||
| 	"fmt" |  | ||||||
| 	"io/ioutil" |  | ||||||
| 	"os" |  | ||||||
| 	"path/filepath" |  | ||||||
| 	"testing" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| func TestEmptyUserServicePath(t *testing.T) { |  | ||||||
| 	srvs, err := getUserSrvs("/tmp/fakeuser") |  | ||||||
| 	if nil != err { |  | ||||||
| 		t.Fatal(err) |  | ||||||
| 	} |  | ||||||
| 	if len(srvs) > 0 { |  | ||||||
| 		t.Fatal(fmt.Errorf("sanity fail: shouldn't get services from empty directory")) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	dirs, err := ioutil.ReadDir(filepath.Join("/tmp/fakeuser", srvUserPath)) |  | ||||||
| 	if nil != err { |  | ||||||
| 		t.Fatal(err) |  | ||||||
| 	} |  | ||||||
| 	if len(dirs) > 0 { |  | ||||||
| 		t.Fatal(fmt.Errorf("sanity fail: shouldn't get listing from empty directory")) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	err = os.RemoveAll("/tmp/fakeuser") |  | ||||||
| 	if nil != err { |  | ||||||
| 		panic("couldn't remove /tmp/fakeuser") |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @ -230,7 +230,7 @@ func add() { | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if len(ass) > 0 { | 	if len(ass) > 0 { | ||||||
| 		fmt.Printf("OPTIONS: Making some assumptions...\n\n") | 		fmt.Println("OPTIONS: Making some assumptions...\n") | ||||||
| 		for i := range ass { | 		for i := range ass { | ||||||
| 			fmt.Println("\t" + ass[i]) | 			fmt.Println("\t" + ass[i]) | ||||||
| 		} | 		} | ||||||
| @ -350,7 +350,7 @@ func list() { | |||||||
| 		fmt.Fprintf(os.Stderr, "\n") | 		fmt.Fprintf(os.Stderr, "\n") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	fmt.Printf("serviceman-managed services:\n\n") | 	fmt.Println("serviceman-managed services:\n") | ||||||
| 	for i := range managed { | 	for i := range managed { | ||||||
| 		fmt.Println("\t" + managed[i]) | 		fmt.Println("\t" + managed[i]) | ||||||
| 	} | 	} | ||||||
| @ -360,7 +360,7 @@ func list() { | |||||||
| 	fmt.Println("") | 	fmt.Println("") | ||||||
| 
 | 
 | ||||||
| 	if verbose { | 	if verbose { | ||||||
| 		fmt.Printf("other services:\n\n") | 		fmt.Println("other services:\n") | ||||||
| 		for i := range others { | 		for i := range others { | ||||||
| 			fmt.Println("\t" + others[i]) | 			fmt.Println("\t" + others[i]) | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user