|
@@ -136,6 +136,9 @@ func UserHostDir(c *cli.Context) (string, error) { |
|
|
// CurrentUser returns the username of the user taking action in the current |
|
|
// CurrentUser returns the username of the user taking action in the current |
|
|
// cli.Context. |
|
|
// cli.Context. |
|
|
func CurrentUser(c *cli.Context) (string, error) { |
|
|
func CurrentUser(c *cli.Context) (string, error) { |
|
|
|
|
|
if c.App.Name == "writeas" { |
|
|
|
|
|
return "user", nil |
|
|
|
|
|
} |
|
|
// Use user flag value |
|
|
// Use user flag value |
|
|
if c.GlobalString("user") != "" { |
|
|
if c.GlobalString("user") != "" { |
|
|
return c.GlobalString("user"), nil |
|
|
return c.GlobalString("user"), nil |
|
|