This commit is contained in:
2026-01-15 12:37:09 +08:00
parent 6a375db5a1
commit 327f115ef2

View File

@@ -18,12 +18,14 @@ const checkAuth = (value: string = '', baseURL: string = '') => {
}
return false;
};
const DEFAULT_IGNORE = ['node_modules/**', '.git/**', '.next/**', '.astro/**', '.pack-dist/**'];
export class SyncBase {
config: Config;
#filename: string;
#dir: string;
baseURL: string;
defaultIgnore: string[] = ['node_modules/**', '.git/**'];
defaultIgnore: string[] = DEFAULT_IGNORE;
constructor(opts?: SyncOptions) {
const filename = opts?.configFilename || 'kevisual.json';
const dir = opts?.dir || process.cwd();
@@ -71,6 +73,12 @@ export class SyncBase {
const realFilename = path.basename(filename);
return { relative: path.relative(dir, file), absolute: file, filename: realFilename };
}
/**
*
* @param syncType
* @param type
* @returns
*/
async canDone(syncType: SyncConfigType, type?: SyncConfigType) {
if (syncType === 'sync') return true;
return syncType === type;