jvcs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,7 @@ async function commitCmd(message) {
46
46
  return
47
47
  }
48
48
 
49
+
49
50
  if(!fssync.existsSync(commits)) {
50
51
  await fs.mkdir(commits)
51
52
  }
@@ -90,7 +90,15 @@ async function unstageCmd(paths) {
90
90
 
91
91
  }
92
92
 
93
- await fs.writeFile(hashPath, JSON.stringify(hashData, null, 2));
93
+ if(Object.keys(hashData).length === 0) {
94
+ if(fssync.existsSync(hashPath)) {
95
+ await fs.rm(hashPath)
96
+ }
97
+ }
98
+ else {
99
+ await fs.writeFile(hashPath,JSON.stringify(hashData,null,2))
100
+ }
101
+
94
102
  }
95
103
 
96
104
  module.exports = unstageCmd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jvcs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "bin": {
5
5
  "jvcs": "./index.js"
6
6
  },