Update file operation plugins

This commit is contained in:
HaveAGitGat 2023-08-29 18:02:45 +01:00
parent 579aab99e9
commit 80f02bf810
22 changed files with 692 additions and 47 deletions

View file

@ -14,6 +14,12 @@ export const getFileName = (filePath: string): string => {
return parts2.join('.');
};
export const getFileAbosluteDir = (filePath: string):string => {
const parts = filePath.split('/');
parts.pop();
return parts.join('/');
};
export const getFfType = (codecType: string): string => (codecType === 'video' ? 'v' : 'a');
export const getSubStem = ({
@ -92,3 +98,9 @@ export const moveFileAndValidate = async ({
}
}
};
export const getPluginWorkDir = (args: IpluginInputArgs):string => {
const pluginWorkDir = `${args.workDir}/${new Date().getTime()}`;
args.deps.fsextra.ensureDirSync(pluginWorkDir);
return pluginWorkDir;
};