Skip to content

Commit 02074d9

Browse files
authored
[cloud shell] always ignore .devbox directory (#388)
1 parent d626aef commit 02074d9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/cloud/cloud.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,16 @@ func parseVMEnvVar() (username string, vmHostname string) {
220220
// rules to be relative to configDir.
221221
func gitIgnorePaths(configDir string) ([]string, error) {
222222

223+
// We must always ignore .devbox folder. It can contain information that
224+
// is platform-specific, and so we should not sync it to the cloud-shell.
225+
// Platform-specific info includes nix profile links to the nix store,
226+
// and in the future, versions of specific packages in the flakes.lock file.
227+
result := []string{".devbox"}
228+
223229
fpath := filepath.Join(configDir, ".gitignore")
224230
if _, err := os.Stat(fpath); err != nil {
225231
if os.IsNotExist(err) {
226-
return nil, nil
232+
return result, nil
227233
} else {
228234
return nil, errors.WithStack(err)
229235
}
@@ -234,6 +240,6 @@ func gitIgnorePaths(configDir string) ([]string, error) {
234240
return nil, errors.WithStack(err)
235241
}
236242

237-
result := strings.Split(string(contents), "\n")
243+
result = append(result, strings.Split(string(contents), "\n")...)
238244
return result, nil
239245
}

0 commit comments

Comments
 (0)