rolling back nested exclude path

This commit is contained in:
SamKirkland 2022-01-31 00:11:43 -06:00
parent 1d31526b7a
commit 93a0898871
3 changed files with 6 additions and 15 deletions

13
dist/index.js vendored
View File

@ -3316,7 +3316,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.applyExcludeFilter = exports.applyFolderFiltersToSubItems = exports.getDefaultSettings = exports.Timer = exports.Timings = exports.retryRequest = exports.formatNumber = exports.pluralize = exports.Logger = void 0; exports.applyExcludeFilter = exports.getDefaultSettings = exports.Timer = exports.Timings = exports.retryRequest = exports.formatNumber = exports.pluralize = exports.Logger = void 0;
const pretty_ms_1 = __importDefault(__nccwpck_require__(1127)); const pretty_ms_1 = __importDefault(__nccwpck_require__(1127));
const module_1 = __nccwpck_require__(8347); const module_1 = __nccwpck_require__(8347);
const types_1 = __nccwpck_require__(6703); const types_1 = __nccwpck_require__(6703);
@ -3463,21 +3463,12 @@ function getDefaultSettings(withoutDefaults) {
"state-name": (_e = withoutDefaults["state-name"]) !== null && _e !== void 0 ? _e : ".ftp-deploy-sync-state.json", "state-name": (_e = withoutDefaults["state-name"]) !== null && _e !== void 0 ? _e : ".ftp-deploy-sync-state.json",
"dry-run": (_f = withoutDefaults["dry-run"]) !== null && _f !== void 0 ? _f : false, "dry-run": (_f = withoutDefaults["dry-run"]) !== null && _f !== void 0 ? _f : false,
"dangerous-clean-slate": (_g = withoutDefaults["dangerous-clean-slate"]) !== null && _g !== void 0 ? _g : false, "dangerous-clean-slate": (_g = withoutDefaults["dangerous-clean-slate"]) !== null && _g !== void 0 ? _g : false,
"exclude": applyFolderFiltersToSubItems((_h = withoutDefaults.exclude) !== null && _h !== void 0 ? _h : module_1.excludeDefaults), "exclude": (_h = withoutDefaults.exclude) !== null && _h !== void 0 ? _h : module_1.excludeDefaults,
"log-level": (_j = withoutDefaults["log-level"]) !== null && _j !== void 0 ? _j : "standard", "log-level": (_j = withoutDefaults["log-level"]) !== null && _j !== void 0 ? _j : "standard",
"security": (_k = withoutDefaults.security) !== null && _k !== void 0 ? _k : "loose", "security": (_k = withoutDefaults.security) !== null && _k !== void 0 ? _k : "loose",
}; };
} }
exports.getDefaultSettings = getDefaultSettings; exports.getDefaultSettings = getDefaultSettings;
/**
* automatically exclude all sub-files/sub-folders if we exclude a folder.
* For example "test/" should also exclude "test/file.txt"
* to do this we add "**" to all folder paths
*/
function applyFolderFiltersToSubItems(excludeFilters) {
return excludeFilters.map(filter => filter.endsWith("/") ? `${filter}**` : filter);
}
exports.applyFolderFiltersToSubItems = applyFolderFiltersToSubItems;
function applyExcludeFilter(stat, excludeFilters) { function applyExcludeFilter(stat, excludeFilters) {
// match exclude, return immediatley // match exclude, return immediatley
if (excludeFilters.length > 0) { if (excludeFilters.length > 0) {

6
package-lock.json generated
View File

@ -712,9 +712,9 @@
} }
}, },
"@samkirkland/ftp-deploy": { "@samkirkland/ftp-deploy": {
"version": "1.2.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/@samkirkland/ftp-deploy/-/ftp-deploy-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@samkirkland/ftp-deploy/-/ftp-deploy-1.2.1.tgz",
"integrity": "sha512-i5z1FGI9746BRc232x82YcI6pdwjWPiSMOhCdltGMLb7K66gxpXV1CB/WxXcs5kvdoMPu3BSdhAAS3o5g/CX+w==", "integrity": "sha512-1Oosu9jN1BDze1cM9jx+vGb04tvGhBaiBL0F1y8kknTqDH7nc889mMBIbAFyhuFefU88oE72J2iCnkqqNNQ/jg==",
"requires": { "requires": {
"basic-ftp": "^4.6.6", "basic-ftp": "^4.6.6",
"lodash": "^4.17.21", "lodash": "^4.17.21",

View File

@ -23,7 +23,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.6.0", "@actions/core": "^1.6.0",
"@samkirkland/ftp-deploy": "^1.2.0", "@samkirkland/ftp-deploy": "^1.2.1",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"jest": "^27.2.5", "jest": "^27.2.5",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",