jvcs 1.1.4 → 1.1.6
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.
- package/controllers/push.js +1 -1
- package/controllers/revert.js +19 -14
- package/package.json +1 -1
- package/.jvcs/HEAD +0 -1
- package/.jvcs/commits/38954e15-be97-42ba-9f2a-385340973ddf/jvcs_hashcode.json +0 -6
- package/.jvcs/commits/38954e15-be97-42ba-9f2a-385340973ddf/meta.json +0 -7
- package/.jvcs/commits/38954e15-be97-42ba-9f2a-385340973ddf/package.json +0 -20
- package/.jvcs/config.json +0 -9
- package/.jvcs/staging/jvcs_hashcode.json +0 -6
- package/.jvcs/staging/package.json +0 -20
package/controllers/push.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
2
|
const path = require("path")
|
|
3
3
|
const chalk = require("chalk")
|
|
4
|
-
const { getDriveClient } = require("../config/drive-config")
|
|
4
|
+
const { getDriveClient } = require("../config/drive-config")
|
|
5
5
|
const drive = getDriveClient()
|
|
6
6
|
const { getGlobalConfig, checkGlobalConfig, checkforjvcs } = require("./utility")
|
|
7
7
|
const getDirectoryStructure = require("./driveUtility")
|
package/controllers/revert.js
CHANGED
|
@@ -39,25 +39,30 @@ function cleanCWD() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
let toDelete = []
|
|
45
|
-
|
|
46
|
-
while(currentCommit && currentCommit !== targetCommit) {
|
|
42
|
+
function buildCommitMap(commitFolder) {
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
toDelete.push(currentCommit)
|
|
53
|
-
|
|
54
|
-
let parent = null
|
|
44
|
+
const map = {}
|
|
45
|
+
const dirs = fs.readdirSync(commitFolder)
|
|
46
|
+
for(const dir of dirs) {
|
|
47
|
+
const metaPath = path.join(commitFolder,dir,"meta.json")
|
|
55
48
|
if(fs.existsSync(metaPath)) {
|
|
56
49
|
const data = JSON.parse(fs.readFileSync(metaPath,"utf-8"))
|
|
57
|
-
|
|
50
|
+
map[dir] = data.parent
|
|
58
51
|
}
|
|
52
|
+
}
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
return map
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function getCommitsToDelete(commitFolder,currentCommit,targetCommit) {
|
|
58
|
+
|
|
59
|
+
const commitMap = buildCommitMap(commitFolder)
|
|
60
|
+
console.log("Commit Map:", commitMap); // 👈 debug log
|
|
61
|
+
const toDelete = []
|
|
62
|
+
|
|
63
|
+
while(currentCommit && currentCommit !== targetCommit) {
|
|
64
|
+
toDelete.push(currentCommit)
|
|
65
|
+
currentCommit = commitMap[currentCommit] || null
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
return toDelete
|
package/package.json
CHANGED
package/.jvcs/HEAD
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
38954e15-be97-42ba-9f2a-385340973ddf
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jvcs",
|
|
3
|
-
"version": "1.1.0",
|
|
4
|
-
"bin": {
|
|
5
|
-
"jvcs": "./index.js"
|
|
6
|
-
},
|
|
7
|
-
"keywords": [],
|
|
8
|
-
"author": "",
|
|
9
|
-
"license": "ISC",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"chalk": "^4.1.2",
|
|
12
|
-
"crypto": "^1.0.1",
|
|
13
|
-
"dotenv": "^17.2.3",
|
|
14
|
-
"googleapis": "^164.1.0",
|
|
15
|
-
"inquirer": "^8.2.7",
|
|
16
|
-
"uuid": "^13.0.0",
|
|
17
|
-
"validator": "^13.15.20",
|
|
18
|
-
"yargs": "^18.0.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
package/.jvcs/config.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jvcs",
|
|
3
|
-
"version": "1.1.0",
|
|
4
|
-
"bin": {
|
|
5
|
-
"jvcs": "./index.js"
|
|
6
|
-
},
|
|
7
|
-
"keywords": [],
|
|
8
|
-
"author": "",
|
|
9
|
-
"license": "ISC",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"chalk": "^4.1.2",
|
|
12
|
-
"crypto": "^1.0.1",
|
|
13
|
-
"dotenv": "^17.2.3",
|
|
14
|
-
"googleapis": "^164.1.0",
|
|
15
|
-
"inquirer": "^8.2.7",
|
|
16
|
-
"uuid": "^13.0.0",
|
|
17
|
-
"validator": "^13.15.20",
|
|
18
|
-
"yargs": "^18.0.0"
|
|
19
|
-
}
|
|
20
|
-
}
|