@@ -94,7 +94,6 @@ func dotfiles() *cobra.Command {
94
94
}
95
95
_ , _ = fmt .Fprintln (cmd .OutOrStdout (), string (out ))
96
96
97
- // check for install scripts
98
97
files , err := os .ReadDir (dotfilesDir )
99
98
if err != nil {
100
99
return xerrors .Errorf ("reading files in dir %s: %w" , dotfilesDir , err )
@@ -154,7 +153,6 @@ func dotfiles() *cobra.Command {
154
153
return nil
155
154
}
156
155
157
- // run found install scripts
158
156
_ , err = cliui .Prompt (cmd , cliui.PromptOptions {
159
157
Text : fmt .Sprintf ("Running install script %s.\n \n Continue?" , script ),
160
158
IsConfirm : true ,
@@ -186,6 +184,7 @@ func dotfiles() *cobra.Command {
186
184
return cmd
187
185
}
188
186
187
+ // dirExists checks if the dir already exists.
189
188
func dirExists (name string ) (bool , error ) {
190
189
_ , err := os .Stat (name )
191
190
if err != nil {
@@ -199,8 +198,9 @@ func dirExists(name string) (bool, error) {
199
198
return true , nil
200
199
}
201
200
202
- func findScript (installScriptSet []string , files []fs.DirEntry ) string {
203
- for _ , i := range installScriptSet {
201
+ // findScript will find the first file that matches the script set.
202
+ func findScript (scriptSet []string , files []fs.DirEntry ) string {
203
+ for _ , i := range scriptSet {
204
204
for _ , f := range files {
205
205
if f .Name () == i {
206
206
return f .Name ()
0 commit comments