Skip to content

Commit 8b31f17

Browse files
committed
Merge branch version/0-37-0-RC1 to adopt changes from PR #2402
2 parents 8c51d1f + 13d35cc commit 8b31f17

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

cmd/state/internal/cmdtree/checkout.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ func newCheckoutCommand(prime *primer.Values) *captain.Command {
2525
Value: &params.Branch,
2626
},
2727
{
28-
Name: locale.Tl("flag_state_checkout_cache", "set-cache"),
29-
Description: locale.Tl("flag_state_checkout_cache_description", "Path to store the runtime files"),
30-
Value: &params.Cache,
28+
Name: locale.Tl("flag_state_checkout_runtime-path", "runtime-path"),
29+
Description: locale.Tl("flag_state_checkout_runtime-path_description", "Path to store the runtime files"),
30+
Value: &params.RuntimePath,
3131
},
3232
},
3333
[]*captain.Argument{

internal/runners/checkout/checkout.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Params struct {
2424
Namespace *project.Namespaced
2525
PreferredPath string
2626
Branch string
27-
Cache string
27+
RuntimePath string
2828
}
2929

3030
type primeable interface {
@@ -66,7 +66,7 @@ func (u *Checkout) Run(params *Params) error {
6666

6767
logging.Debug("Checking out %s to %s", params.Namespace.String(), params.PreferredPath)
6868
var err error
69-
projectDir, err := u.checkout.Run(params.Namespace, params.Branch, params.Cache, params.PreferredPath)
69+
projectDir, err := u.checkout.Run(params.Namespace, params.Branch, params.RuntimePath, params.PreferredPath)
7070
if err != nil {
7171
return locale.WrapError(err, "err_checkout_project", "", params.Namespace.String())
7272
}

test/integration/checkout_int_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,26 @@ func (suite *CheckoutIntegrationTestSuite) TestCheckoutWithFlags() {
149149
cp.ExpectExitCode(1)
150150
}
151151

152-
func (suite *CheckoutIntegrationTestSuite) TestCheckoutCustomCache() {
152+
func (suite *CheckoutIntegrationTestSuite) TestCheckoutCustomRTPath() {
153153
suite.OnlyRunForTags(tagsuite.Checkout)
154154

155155
ts := e2e.New(suite.T(), true)
156156
defer ts.Close()
157157

158-
customCache, err := fileutils.ResolveUniquePath(filepath.Join(ts.Dirs.Work, "custom-cache"))
158+
customRTPath, err := fileutils.ResolveUniquePath(filepath.Join(ts.Dirs.Work, "custom-cache"))
159159
suite.Require().NoError(err)
160-
err = fileutils.Mkdir(customCache)
160+
err = fileutils.Mkdir(customRTPath)
161161
suite.Require().NoError(err)
162162

163163
// Checkout and verify.
164164
cp := ts.SpawnWithOpts(
165-
e2e.WithArgs("checkout", "ActiveState-CLI/Python3", fmt.Sprintf("--set-cache=%s", customCache)),
165+
e2e.WithArgs("checkout", "ActiveState-CLI/Python3", fmt.Sprintf("--runtime-path=%s", customRTPath)),
166166
e2e.AppendEnv("ACTIVESTATE_CLI_DISABLE_RUNTIME=false"),
167167
)
168168
cp.Expect("Checked out project")
169169

170-
pythonExe := filepath.Join(setup.ExecDir(customCache), "python3"+exeutils.Extension)
171-
suite.Require().True(fileutils.DirExists(customCache))
170+
pythonExe := filepath.Join(setup.ExecDir(customRTPath), "python3"+exeutils.Extension)
171+
suite.Require().True(fileutils.DirExists(customRTPath))
172172
suite.Require().True(fileutils.FileExists(pythonExe))
173173

174174
// Verify runtime was installed correctly and works.
@@ -183,11 +183,11 @@ func (suite *CheckoutIntegrationTestSuite) TestCheckoutCustomCache() {
183183
e2e.WithWorkDirectory(filepath.Join(ts.Dirs.Work, "Python3")),
184184
)
185185
if runtime.GOOS == "windows" {
186-
customCache, err = fileutils.GetLongPathName(customCache)
186+
customRTPath, err = fileutils.GetLongPathName(customRTPath)
187187
suite.Require().NoError(err)
188-
customCache = strings.ToLower(customCache)
188+
customRTPath = strings.ToLower(customRTPath)
189189
}
190-
cp.Expect(customCache)
190+
cp.Expect(customRTPath)
191191
}
192192

193193
func TestCheckoutIntegrationTestSuite(t *testing.T) {

0 commit comments

Comments
 (0)