Add new copy/move options

This commit is contained in:
HaveAGitGat 2023-08-28 10:43:23 +01:00
parent f410caf1ad
commit ca8ec26b81
9 changed files with 326 additions and 33 deletions

View file

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFfType = exports.getFileName = exports.getContainer = void 0;
exports.getSubStem = exports.getFfType = exports.getFileName = exports.getContainer = void 0;
var getContainer = function (filePath) {
var parts = filePath.split('.');
return parts[parts.length - 1];
@ -10,8 +10,17 @@ var getFileName = function (filePath) {
var parts = filePath.split('/');
var fileNameAndContainer = parts[parts.length - 1];
var parts2 = fileNameAndContainer.split('.');
return parts2[0];
parts2.pop();
return parts2.join('.');
};
exports.getFileName = getFileName;
var getFfType = function (codecType) { return (codecType === 'video' ? 'v' : 'a'); };
exports.getFfType = getFfType;
var getSubStem = function (_a) {
var inputPathStem = _a.inputPathStem, inputPath = _a.inputPath;
var subStem = inputPath.substring(inputPathStem.length);
var parts = subStem.split('/');
parts.pop();
return parts.join('/');
};
exports.getSubStem = getSubStem;

View file

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var formatWindowsRootFolder = function (path) {
// Remove '.' from end of Windows root folder mapping e.g. 'E:.'
if (path.length === 3
&& path.charAt(1) === ':'
&& path.charAt(2) === '.') {
// eslint-disable-next-line no-param-reassign
path = path.slice(0, -1);
}
return path;
};
var normJoinPath = function (_a) {
var upath = _a.upath, paths = _a.paths;
var path = upath.joinSafe.apply(upath, paths);
path = formatWindowsRootFolder(path);
return path;
};
exports.default = normJoinPath;