Skip to content

Commit 653cc0e

Browse files
committed
FIX copy with truncate mode
1 parent 3bb8311 commit 653cc0e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Added `--local` flag to `use` command
44
- Updated readme with brew instructions
5+
- Fixed an issue where remaining lines of .npmrc file were not truncated
56

67
## 0.1.2
78

cmd/npmrc/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func CP(sourcefile, destfile string) error {
6868
}
6969
defer source.Close()
7070

71-
dest, err := os.OpenFile(destfile, os.O_RDWR|os.O_CREATE, 0666)
71+
dest, err := os.OpenFile(destfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
7272
if err != nil {
7373
log.Fatal(err)
7474
os.Exit(1)

0 commit comments

Comments
 (0)