File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ struct SelfUninstall: SwiftlyCommand {
45
45
try await Self . execute ( ctx, verbose: self . root. verbose)
46
46
}
47
47
48
- static func execute( _ ctx: SwiftlyCoreContext , verbose _ : Bool ) async throws {
48
+ static func execute( _ ctx: SwiftlyCoreContext , verbose: Bool ) async throws {
49
49
await ctx. print ( " Uninstalling swiftly... " )
50
50
51
51
let userHome = ctx. mockedHomeDir ?? fs. home
@@ -82,13 +82,18 @@ struct SelfUninstall: SwiftlyCommand {
82
82
83
83
// Remove swiftly source lines from shell profiles
84
84
for path in profilePaths where try await fs. exists ( atPath: path) {
85
- await ctx. print ( " Updating \( path) ... " )
85
+ if verbose {
86
+ await ctx. print ( " Checking \( path) ... " )
87
+ }
86
88
let isFish = path. extension == " fish "
87
89
let sourceLine = isFish ? fishSourceLine : shSourceLine
88
90
let contents = try String ( contentsOf: path, encoding: . utf8)
89
91
if contents. contains ( sourceLine) {
90
92
let updated = contents. replacingOccurrences ( of: sourceLine, with: " " )
91
93
try Data ( updated. utf8) . write ( to: path, options: [ . atomic] )
94
+ if verbose {
95
+ await ctx. print ( " \( path) was updated to remove swiftly source line. " )
96
+ }
92
97
}
93
98
}
94
99
You can’t perform that action at this time.
0 commit comments