pinokiod 3.19.122 → 3.20.0
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/kernel/bin/cli.js +6 -5
- package/kernel/bin/git.js +18 -0
- package/kernel/git.js +0 -4
- package/kernel/scripts/git/checkout +11 -0
- package/kernel/scripts/git/reset_commit +11 -0
- package/kernel/scripts/git/reset_file +11 -0
- package/kernel/shell.js +0 -2
- package/kernel/util.js +14 -11
- package/package.json +1 -1
- package/server/index.js +105 -157
- package/server/public/tom-select.bootstrap5.css +2 -0
- package/server/public/tom-select.complete.min.js +444 -0
- package/server/public/tom-select.css +412 -0
- package/server/views/app.ejs +12 -3
- package/server/views/git.ejs +386 -70
- package/server/views/partials/repos.ejs +1 -1
- package/server/views/terminal.ejs +57 -2
package/kernel/bin/cli.js
CHANGED
|
@@ -16,8 +16,9 @@ class CLI {
|
|
|
16
16
|
exists = await Util.exists(this.kernel.path("bin/npm/bin/pterm"))
|
|
17
17
|
}
|
|
18
18
|
if (exists) {
|
|
19
|
-
let p = this.kernel.which("pterm")
|
|
20
|
-
|
|
19
|
+
// let p = this.kernel.which("pterm")
|
|
20
|
+
// console.log({ exists, p})
|
|
21
|
+
// if (p) {
|
|
21
22
|
let res = await this.kernel.exec({
|
|
22
23
|
message: "pterm version terminal"
|
|
23
24
|
}, ondata)
|
|
@@ -33,9 +34,9 @@ class CLI {
|
|
|
33
34
|
} else {
|
|
34
35
|
return false
|
|
35
36
|
}
|
|
36
|
-
} else {
|
|
37
|
-
return false
|
|
38
|
-
}
|
|
37
|
+
// } else {
|
|
38
|
+
// return false
|
|
39
|
+
// }
|
|
39
40
|
} else {
|
|
40
41
|
return false
|
|
41
42
|
}
|
package/kernel/bin/git.js
CHANGED
|
@@ -66,6 +66,24 @@ class Git {
|
|
|
66
66
|
path.resolve(__dirname, "..", "scripts/git/commit"),
|
|
67
67
|
gitcommit_path
|
|
68
68
|
)
|
|
69
|
+
|
|
70
|
+
let gitcheckout_path = path.resolve(this.kernel.homedir, "scripts/git/checkout.json")
|
|
71
|
+
await fs.promises.copyFile(
|
|
72
|
+
path.resolve(__dirname, "..", "scripts/git/checkout"),
|
|
73
|
+
gitcheckout_path
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
let gitreset_commit_path = path.resolve(this.kernel.homedir, "scripts/git/reset_commit.json")
|
|
77
|
+
await fs.promises.copyFile(
|
|
78
|
+
path.resolve(__dirname, "..", "scripts/git/reset_commit"),
|
|
79
|
+
gitreset_commit_path
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
let gitreset_file_path = path.resolve(this.kernel.homedir, "scripts/git/reset_file.json")
|
|
83
|
+
await fs.promises.copyFile(
|
|
84
|
+
path.resolve(__dirname, "..", "scripts/git/reset_file"),
|
|
85
|
+
gitreset_file_path
|
|
86
|
+
)
|
|
69
87
|
}
|
|
70
88
|
async installed() {
|
|
71
89
|
let gitconfig_path = path.resolve(this.kernel.homedir, "gitconfig")
|
package/kernel/git.js
CHANGED
|
@@ -28,7 +28,6 @@ class Git {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async repos (root) {
|
|
31
|
-
console.time("Repos " + root)
|
|
32
31
|
let _repos = await this.findGitDirs(root)
|
|
33
32
|
// let _repos = await glob('**/.git/', {
|
|
34
33
|
// cwd: root,
|
|
@@ -36,10 +35,8 @@ class Git {
|
|
|
36
35
|
// dot: true,
|
|
37
36
|
// ignore: ['**/node_modules/**', "**/venv/**"], // optional
|
|
38
37
|
// });
|
|
39
|
-
console.timeEnd("Repos " + root)
|
|
40
38
|
|
|
41
39
|
let name = path.basename(root)
|
|
42
|
-
console.time("Get config " + root)
|
|
43
40
|
|
|
44
41
|
let repos = []
|
|
45
42
|
for(let r of _repos) {
|
|
@@ -83,7 +80,6 @@ class Git {
|
|
|
83
80
|
}
|
|
84
81
|
this.dirs.add(dir)
|
|
85
82
|
}
|
|
86
|
-
console.timeEnd("Get config " + root)
|
|
87
83
|
return repos
|
|
88
84
|
}
|
|
89
85
|
async config (dir) {
|
package/kernel/shell.js
CHANGED
|
@@ -1015,9 +1015,7 @@ class Shell {
|
|
|
1015
1015
|
return params
|
|
1016
1016
|
}
|
|
1017
1017
|
async exec(params) {
|
|
1018
|
-
console.log("before activate", params.message)
|
|
1019
1018
|
params = await this.activate(params)
|
|
1020
|
-
console.log("after activate", params.message)
|
|
1021
1019
|
this.cmd = this.build(params)
|
|
1022
1020
|
console.log("build", this.cmd)
|
|
1023
1021
|
let res = await new Promise((resolve, reject) => {
|
package/kernel/util.js
CHANGED
|
@@ -709,8 +709,10 @@ const ignore_subrepos = async (root_path, repos) => {
|
|
|
709
709
|
'/facefusion-pinokio.git/facefusion/'
|
|
710
710
|
]
|
|
711
711
|
*/
|
|
712
|
-
let repo_paths = repos.
|
|
713
|
-
return
|
|
712
|
+
let repo_paths = repos.filter((r) => {
|
|
713
|
+
return r.gitParentPath !== root_path
|
|
714
|
+
}).map((r) => {
|
|
715
|
+
return "/" + path.relative(root_path, r.gitParentPath) + "/"
|
|
714
716
|
})
|
|
715
717
|
|
|
716
718
|
let gitignore = path.resolve(root_path, ".gitignore")
|
|
@@ -723,16 +725,17 @@ const ignore_subrepos = async (root_path, repos) => {
|
|
|
723
725
|
content = await fs.promises.readFile(gitignore, "utf8");
|
|
724
726
|
lines = content.split(/\r?\n/);
|
|
725
727
|
} catch (err) {
|
|
726
|
-
// if (err.code !== "ENOENT") throw err; // ignore missing file, throw others
|
|
727
728
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
|
|
729
|
+
// if (err.code !== "ENOENT") throw err; // ignore missing file, throw others
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
if (content) {
|
|
733
|
+
const trimmedLines = lines.map(line => line.trim());
|
|
734
|
+
const missingRepos = repo_paths.filter(repo => !trimmedLines.includes(repo));
|
|
735
|
+
if (missingRepos.length > 0) {
|
|
736
|
+
const textToAppend = (content.endsWith("\n") ? "" : "\n") + missingRepos.join("\n") + "\n";
|
|
737
|
+
await fs.promises.appendFile(gitignore, textToAppend, "utf8");
|
|
738
|
+
}
|
|
736
739
|
}
|
|
737
740
|
} else {
|
|
738
741
|
// does not exist, don't do anything yet
|