Merge pull request #542 from HaveAGitGat/parser_update

Use fileMoveOrCopy
This commit is contained in:
HaveAGitGat 2023-11-14 07:08:40 +00:00 committed by GitHub
commit 66c3519ccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 673 additions and 41 deletions

View file

@ -40,6 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
var fileMoveOrCopy_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/fileMoveOrCopy"));
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
var normJoinPath_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/normJoinPath"));
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
@ -137,9 +138,10 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
}];
}
args.deps.fsextra.ensureDirSync(outputPath);
return [4 /*yield*/, (0, fileUtils_1.moveFileAndValidate)({
inputPath: args.inputFileObj._id,
outputPath: ouputFilePath,
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: 'move',
sourcePath: args.inputFileObj._id,
destinationPath: ouputFilePath,
args: args,
})];
case 1:

View file

@ -35,8 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
var fileMoveOrCopy_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/fileMoveOrCopy"));
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
@ -83,9 +87,10 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
variables: args.variables,
}];
}
return [4 /*yield*/, (0, fileUtils_1.moveFileAndValidate)({
inputPath: args.inputFileObj._id,
outputPath: ouputFilePath,
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: 'move',
sourcePath: args.inputFileObj._id,
destinationPath: ouputFilePath,
args: args,
})];
case 1:

View file

@ -35,8 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
var fileMoveOrCopy_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/fileMoveOrCopy"));
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
@ -97,9 +101,10 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
variables: args.variables,
}];
}
return [4 /*yield*/, (0, fileUtils_1.moveFileAndValidate)({
inputPath: args.inputFileObj._id,
outputPath: newPath,
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: 'move',
sourcePath: args.inputFileObj._id,
destinationPath: newPath,
args: args,
})];
case 1:

View file

@ -35,8 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.plugin = exports.details = void 0;
var fileMoveOrCopy_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/fileMoveOrCopy"));
var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils");
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
var details = function () { return ({
@ -94,9 +98,10 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
case 1:
_a.sent();
return [4 /*yield*/, (0, fileUtils_1.moveFileAndValidate)({
inputPath: currentPath,
outputPath: newPathTmp,
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: 'move',
sourcePath: currentPath,
destinationPath: newPathTmp,
args: args,
})];
case 2:
@ -110,9 +115,10 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })];
case 3:
_a.sent();
return [4 /*yield*/, (0, fileUtils_1.moveFileAndValidate)({
inputPath: newPathTmp,
outputPath: newPath,
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: 'move',
sourcePath: newPathTmp,
destinationPath: newPath,
args: args,
})];
case 4: