Skip to content

Commit fa71dd2

Browse files
authored
Merge pull request #379 from defang-io/lio-cli-delete
Deprecate delete command
2 parents ff77a0b + 83d80f7 commit fa71dd2

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/cmd/cli/command/commands.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ var deleteCmd = &cobra.Command{
873873
Args: cobra.MinimumNArgs(1),
874874
Aliases: []string{"del", "rm", "remove"},
875875
Short: "Delete a service from the cluster",
876+
Deprecated: "use 'compose stop' instead",
876877
RunE: func(cmd *cobra.Command, names []string) error {
877878
var tail, _ = cmd.Flags().GetBool("tail")
878879

@@ -969,7 +970,7 @@ var logoutCmd = &cobra.Command{
969970
var bootstrapCmd = &cobra.Command{
970971
Use: "cd",
971972
Aliases: []string{"bootstrap"},
972-
Short: "Manually run a command with the CD task",
973+
Short: "Manually run a command with the CD task (for BYOC only)",
973974
}
974975

975976
var bootstrapDestroyCmd = &cobra.Command{

src/pkg/cli/client/byoc/aws/byoc.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,12 @@ func (b *ByocAws) environment() map[string]string {
372372
func (b *ByocAws) runCdCommand(ctx context.Context, cmd ...string) (ecs.TaskArn, error) {
373373
env := b.environment()
374374
if term.DoDebug {
375-
debugEnv := " -"
375+
debugEnv := fmt.Sprintf("AWS_REGION=%q", b.driver.Region)
376+
if awsProfile := os.Getenv("AWS_PROFILE"); awsProfile != "" {
377+
debugEnv += fmt.Sprintf(" AWS_PROFILE=%q", awsProfile)
378+
}
376379
for k, v := range env {
377-
debugEnv += " " + k + "=" + v
380+
debugEnv += fmt.Sprintf(" %s=%q", k, v)
378381
}
379382
term.Debug(debugEnv, "npm run dev", strings.Join(cmd, " "))
380383
}

src/pkg/cli/composeDown.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ func ComposeDown(ctx context.Context, client client.Client) (types.ETag, error)
1414
return "", err
1515
}
1616
term.Debug(" - Destroying project", projectName)
17+
18+
if DoDryRun {
19+
return "", ErrDryRun
20+
}
21+
1722
return client.Destroy(ctx)
1823
}

0 commit comments

Comments
 (0)