pinokiod 3.19.116 → 3.19.118
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/util.js +59 -1
- package/package.json +1 -1
package/kernel/util.js
CHANGED
|
@@ -680,7 +680,65 @@ const mergeLines = async (existingFilepath, filepath2) => {
|
|
|
680
680
|
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
const ignore_subrepos = async (repos) => {
|
|
683
|
+
const ignore_subrepos = async (root_path, repos) => {
|
|
684
|
+
/*
|
|
685
|
+
repos [
|
|
686
|
+
{
|
|
687
|
+
name: 'facefusion-pinokio.git',
|
|
688
|
+
gitPath: '/Users/x/pinokio/api/facefusion-pinokio.git/.git',
|
|
689
|
+
gitRelPath: '.git',
|
|
690
|
+
gitParentPath: '/Users/x/pinokio/api/facefusion-pinokio.git',
|
|
691
|
+
gitParentRelPath: 'facefusion-pinokio.git',
|
|
692
|
+
dir: '/Users/x/pinokio/api/facefusion-pinokio.git',
|
|
693
|
+
url: 'https://github.com/facefusion/facefusion-pinokio.git'
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: 'facefusion-pinokio.git/facefusion',
|
|
697
|
+
gitPath: '/Users/x/pinokio/api/facefusion-pinokio.git/facefusion/.git',
|
|
698
|
+
gitRelPath: 'facefusion/.git',
|
|
699
|
+
gitParentPath: '/Users/x/pinokio/api/facefusion-pinokio.git/facefusion',
|
|
700
|
+
gitParentRelPath: 'facefusion-pinokio.git/facefusion',
|
|
701
|
+
dir: '/Users/x/pinokio/api/facefusion-pinokio.git/facefusion',
|
|
702
|
+
url: 'https://github.com/facefusion/facefusion'
|
|
703
|
+
}
|
|
704
|
+
]
|
|
705
|
+
*/
|
|
706
|
+
/*
|
|
707
|
+
repo_paths = [
|
|
708
|
+
'/facefusion-pinokio.git/'
|
|
709
|
+
'/facefusion-pinokio.git/facefusion/'
|
|
710
|
+
]
|
|
711
|
+
*/
|
|
712
|
+
let repo_paths = repos.map((r) => {
|
|
713
|
+
return "/" + r.gitParentRelPath + "/"
|
|
714
|
+
})
|
|
715
|
+
|
|
716
|
+
let gitignore = path.resolve(root_path, ".gitignore")
|
|
717
|
+
let e = await exists(gitignore)
|
|
718
|
+
if (e) {
|
|
719
|
+
|
|
720
|
+
let lines = [];
|
|
721
|
+
let content
|
|
722
|
+
try {
|
|
723
|
+
content = await fs.promises.readFile(gitignore, "utf8");
|
|
724
|
+
lines = content.split(/\r?\n/);
|
|
725
|
+
} catch (err) {
|
|
726
|
+
// if (err.code !== "ENOENT") throw err; // ignore missing file, throw others
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
const trimmedLines = lines.map(line => line.trim());
|
|
730
|
+
const missingRepos = repos.filter(repo => !trimmedLines.includes(repo));
|
|
731
|
+
|
|
732
|
+
if (missingRepos.length > 0) {
|
|
733
|
+
const textToAppend = (content.endsWith("\n") ? "" : "\n") + missingRepos.join("\n") + "\n";
|
|
734
|
+
console.log("append", textToAppend)
|
|
735
|
+
await fs.promises.appendFile(gitignore, textToAppend, "utf8");
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
738
|
+
// does not exist, don't do anything yet
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
|
|
684
742
|
}
|
|
685
743
|
|
|
686
744
|
|