Skip to content

Commit

Permalink
Implement workspace command
Browse files Browse the repository at this point in the history
  • Loading branch information
Katrina Owen committed Aug 17, 2017
1 parent ff66efa commit 1062506
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cmd/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@ package cmd
import (
"fmt"

"github.com/exercism/cli/config"
"github.com/spf13/cobra"
)

// workspaceCmd outputs the path to the person's workspace directory.
var workspaceCmd = &cobra.Command{
Use: "workspace",
Aliases: []string{"w"},
Short: "Output the path to your workspace.",
Long: `Output the path to your workspace.
Short: "Print out the path to your Exercism workspace.",
Long: `Print out the path to your Exercism workspace.
This command can be combined with shell commands to take you there.
This command can be used for scripting, or it can be combined with shell
commands to take you to your workspace.
For example, on Linux or MacOS you can run:
For example you can run:
cd $(exercism workspace)
On Windows, the equivalent command is:
TODO ask @exercism/windows for help
On Windows, this will work only with Powershell, however you would
need to be on the same drive as your workspace directory. Otherwise
nothing will happen.
`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("workspace called")
usrCfg, err := config.NewUserConfig()
BailOnError(err)
fmt.Println(usrCfg.Workspace)
},
}

Expand Down

0 comments on commit 1062506

Please sign in to comment.