update
This commit is contained in:
@@ -68,7 +68,8 @@ export class SyncBase {
|
|||||||
if (!filename) return false;
|
if (!filename) return false;
|
||||||
const dir = this.#dir;
|
const dir = this.#dir;
|
||||||
const file = path.join(dir, filename);
|
const file = path.join(dir, filename);
|
||||||
return { relative: path.relative(dir, file), absolute: file };
|
const realFilename = path.basename(filename);
|
||||||
|
return { relative: path.relative(dir, file), absolute: file, filename: realFilename };
|
||||||
}
|
}
|
||||||
async canDone(syncType: SyncConfigType, type?: SyncConfigType) {
|
async canDone(syncType: SyncConfigType, type?: SyncConfigType) {
|
||||||
if (syncType === 'sync') return true;
|
if (syncType === 'sync') return true;
|
||||||
|
|||||||
@@ -196,7 +196,19 @@ const clone = new Command('clone')
|
|||||||
const matchList = matchObjectList
|
const matchList = matchObjectList
|
||||||
.map((item2) => {
|
.map((item2) => {
|
||||||
const rp = sync.getRelativePath(item2.pathname);
|
const rp = sync.getRelativePath(item2.pathname);
|
||||||
|
|
||||||
if (!rp) return false;
|
if (!rp) return false;
|
||||||
|
if (rp.absolute.endsWith('gitignore.txt')) {
|
||||||
|
// 修改为 .gitignore
|
||||||
|
const newPath = rp.absolute.replace('gitignore.txt', '.gitignore');
|
||||||
|
rp.absolute = newPath;
|
||||||
|
rp.relative = path.relative(sync.dir, newPath);
|
||||||
|
} else if (rp.absolute.endsWith('.dot')) {
|
||||||
|
const filename = path.basename(rp.absolute, '.dot');
|
||||||
|
const newPath = path.join(path.dirname(rp.absolute), `.${filename}`);
|
||||||
|
rp.absolute = newPath;
|
||||||
|
rp.relative = path.relative(sync.dir, newPath);
|
||||||
|
}
|
||||||
return { ...item2, relative: rp.relative, absolute: rp.absolute };
|
return { ...item2, relative: rp.relative, absolute: rp.absolute };
|
||||||
})
|
})
|
||||||
.filter((i) => i);
|
.filter((i) => i);
|
||||||
|
|||||||
Reference in New Issue
Block a user