Skip to content

Commit a20d5ee

Browse files
committed
fixes the dryRun
1 parent c657e55 commit a20d5ee

File tree

6 files changed

+146
-146
lines changed

6 files changed

+146
-146
lines changed

cmd/kargs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func kargs(cmd *cobra.Command, args []string) error {
7070
cmdr.Error.Println(err)
7171
return err
7272
}
73-
err = aBsys.RunOperation(core.APPLY, false)
73+
err = aBsys.RunOperation(core.APPLY, false, false)
7474
if err != nil {
7575
cmdr.Error.Println(abroot.Trans("pkg.applyFailed"))
7676
return err

cmd/pkg.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,7 @@ func pkg(cmd *cobra.Command, args []string) error {
204204
return err
205205
}
206206

207-
if dryRun {
208-
err = aBsys.RunOperation(core.DRY_RUN_APPLY, deleteOldSystem)
209-
} else {
210-
err = aBsys.RunOperation(core.APPLY, deleteOldSystem)
211-
}
207+
err = aBsys.RunOperation(core.APPLY, deleteOldSystem, dryRun)
212208
if err != nil {
213209
cmdr.Error.Printf(abroot.Trans("pkg.applyFailed"), err)
214210
return err

cmd/rebase.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ func rebase(cmd *cobra.Command, args []string) error {
129129
return err
130130
}
131131

132-
if dryRun {
133-
cmdr.Info.Println(abroot.Trans("rebase.dryRunSuccess"))
134-
}
135-
136132
rebaseOnly, err := cmd.Flags().GetBool("rebase-only")
137133
if err != nil {
138134
cmdr.Error.Println(err)
@@ -144,5 +140,5 @@ func rebase(cmd *cobra.Command, args []string) error {
144140
}
145141

146142
cmdr.Info.Println(abroot.Trans("rebase.successUpdate"))
147-
return abSys.RunOperation("UPGRADE", false)
143+
return abSys.RunOperation("UPGRADE", false, dryRun)
148144
}

cmd/update-initramfs.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ func updateInitramfs(cmd *cobra.Command, args []string) error {
7979
return err
8080
}
8181

82-
if dryRun {
83-
err = aBsys.RunOperation(core.DRY_RUN_INITRAMFS, deleteOldSystem)
84-
} else {
85-
err = aBsys.RunOperation(core.INITRAMFS, deleteOldSystem)
86-
}
82+
err = aBsys.RunOperation(core.INITRAMFS, deleteOldSystem, dryRun)
8783
if err != nil {
8884
cmdr.Error.Printf(abroot.Trans("updateInitramfs.updateFailed"), err)
8985
return err

cmd/upgrade.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,12 @@ func upgrade(cmd *cobra.Command, args []string) error {
253253
var operation core.ABSystemOperation
254254
if force {
255255
operation = core.FORCE_UPGRADE
256-
} else if dryRun {
257-
operation = core.DRY_RUN_UPGRADE
258256
} else {
259257
operation = core.UPGRADE
260258
}
261259

262260
cmdr.Info.Println(abroot.Trans("upgrade.checkingSystemUpdate"))
263-
err = aBsys.RunOperation(operation, deleteOldSystem)
261+
err = aBsys.RunOperation(operation, deleteOldSystem, dryRun)
264262
if err != nil {
265263
if err == core.ErrNoUpdate {
266264
cmdr.Info.Println(abroot.Trans("upgrade.noUpdateAvailable"))

0 commit comments

Comments
 (0)