mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-04 20:02:26 +00:00
torch: skip self-copy during update in self-host installs
This commit is contained in:
1 parent
dcff2e7646
commit
865dbe841c
1 file changed
+8
@@ -148,6 +148,10 @@ function syncAppDirectories(torchDir, verb = 'Copied') {
|
||||
for (const dir of APP_DIRS) {
|
||||
const src = path.join(PKG_ROOT, dir);
|
||||
const dest = path.join(torchDir, dir);
|
||||
if (path.resolve(src) === path.resolve(dest)) {
|
||||
console.log(` Skipping ${dir}/ (source and destination are identical).`);
|
||||
continue;
|
||||
}
|
||||
if (fs.existsSync(src)) {
|
||||
copyDir(src, dest);
|
||||
console.log(` ${verb} ${dir}/`);
|
||||
@@ -167,6 +171,10 @@ function syncAppFiles(torchDir, installDir, verb = 'Copied') {
|
||||
for (const file of APP_FILES) {
|
||||
const src = path.join(PKG_ROOT, file);
|
||||
const dest = path.join(torchDir, file);
|
||||
if (path.resolve(src) === path.resolve(dest)) {
|
||||
console.log(` Skipping ${file} (source and destination are identical).`);
|
||||
continue;
|
||||
}
|
||||
if (fs.existsSync(src)) {
|
||||
if (installDir === '.' && file === 'package.json') {
|
||||
if (verb === 'Copied' && fs.existsSync(dest)) {
|
||||
|
||||
Reference in new issue
Block a user