feat(cli): implement exec and exec_all commands
This commit is contained in:
@@ -68,6 +68,17 @@ func (s *CLISuite) TestRun_Cd_ExplicitCastle() {
|
||||
require.Empty(s.T(), s.stderr.String())
|
||||
}
|
||||
|
||||
func (s *CLISuite) TestRun_Exec_RunsCommandInCastleRoot() {
|
||||
castleRoot := filepath.Join(s.homeDir, ".homesick", "repos", "dotfiles")
|
||||
require.NoError(s.T(), os.MkdirAll(castleRoot, 0o755))
|
||||
|
||||
exitCode := cli.Run([]string{"exec", "dotfiles", "pwd"}, s.stdout, s.stderr)
|
||||
|
||||
require.Equal(s.T(), 0, exitCode)
|
||||
require.Contains(s.T(), s.stdout.String(), castleRoot)
|
||||
require.Empty(s.T(), s.stderr.String())
|
||||
}
|
||||
|
||||
func (s *CLISuite) TestRun_CloneSubcommandHelp() {
|
||||
exitCode := cli.Run([]string{"clone", "--help"}, s.stdout, s.stderr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user