Skip to content

Commit

Permalink
dev: dev cache --clean cleans out only the cache subdirectory
Browse files Browse the repository at this point in the history
Without this change `dev cache --clean` can trample your configuration
file.

Release note: None
  • Loading branch information
rickystewart committed Feb 8, 2022
1 parent 4d95f56 commit e4a26b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

# Bump this counter to force rebuilding `dev` on all machines.
DEV_VERSION=11
DEV_VERSION=12

THIS_DIR=$(cd "$(dirname "$0")" && pwd)
BINARY_DIR=$THIS_DIR/bin/dev-versions
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/dev/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (d *dev) cleanCache(ctx context.Context) error {
if err != nil {
return err
}
return os.RemoveAll(dir)
return os.RemoveAll(filepath.Join(dir, "cache"))
}

func (d *dev) getCacheBazelrcLine(ctx context.Context) (string, error) {
Expand Down

0 comments on commit e4a26b5

Please sign in to comment.