From 8a990dcf436d35d80cc91da52651c6d7f62b8105 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Thu, 22 Feb 2024 15:06:05 -0500 Subject: [PATCH] revert to older moveConfig that i guess silently failed in a good way --- package-lock.json | 29 ++++++++++++++++++++++++++++- package.json | 1 + utils/move-config.js | 8 ++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a6cc744c..e3248877c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@lando/core", - "version": "3.21.0-beta.1", + "version": "3.21.0-beta.3", "license": "GPL-3.0", "dependencies": { "@npmcli/arborist": "^6.2.9", @@ -15,6 +15,7 @@ "bluebird": "^3.4.1", "clean-stacktrace": "^1.1.0", "cli-truncate": "2.1.0", + "copy-dir": "^0.4.0", "debug": "^4.3.4", "delay": "^5", "dockerfile-generator": "^5.0.0", @@ -4775,6 +4776,14 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/copy-dir": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/copy-dir/-/copy-dir-0.4.0.tgz", + "integrity": "sha512-mIefrD97nE1XX2th570tR5UQvW6/92czEPGe+oTtrxPAJl+KOKLpzcRa+e38WEpmt/IUN1n65KvRMzPblR+fDQ==", + "dependencies": { + "mkdir-p": "~0.0.4" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -8488,6 +8497,11 @@ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "dev": true }, + "node_modules/mkdir-p": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mkdir-p/-/mkdir-p-0.0.7.tgz", + "integrity": "sha512-VkWaZNxDgZle/aJAemUAWdyYX7geyuleKYFfRejf/pFKjxBDbWrMAy41ijg5EiI1U00WR9JcvynuDedE/fTxLA==" + }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -16078,6 +16092,14 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "copy-dir": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/copy-dir/-/copy-dir-0.4.0.tgz", + "integrity": "sha512-mIefrD97nE1XX2th570tR5UQvW6/92czEPGe+oTtrxPAJl+KOKLpzcRa+e38WEpmt/IUN1n65KvRMzPblR+fDQ==", + "requires": { + "mkdir-p": "~0.0.4" + } + }, "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -18815,6 +18837,11 @@ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "dev": true }, + "mkdir-p": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mkdir-p/-/mkdir-p-0.0.7.tgz", + "integrity": "sha512-VkWaZNxDgZle/aJAemUAWdyYX7geyuleKYFfRejf/pFKjxBDbWrMAy41ijg5EiI1U00WR9JcvynuDedE/fTxLA==" + }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", diff --git a/package.json b/package.json index a32e9a6ef..6add4098d 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "bluebird": "^3.4.1", "clean-stacktrace": "^1.1.0", "cli-truncate": "2.1.0", + "copy-dir": "^0.4.0", "debug": "^4.3.4", "delay": "^5", "dockerfile-generator": "^5.0.0", diff --git a/utils/move-config.js b/utils/move-config.js index cc356e4b6..52d390201 100644 --- a/utils/move-config.js +++ b/utils/move-config.js @@ -1,6 +1,7 @@ 'use strict'; const _ = require('lodash'); +const copydir = require('copy-dir'); const fs = require('fs-extra'); const os = require('os'); const path = require('path'); @@ -8,14 +9,13 @@ const path = require('path'); module.exports = (src, dest = os.tmpdir()) => { // Copy opts and filter out all js files // We don't want to give the false impression that you can edit the JS - const filter = (src, dest) => path.extname(src) !== '.js'; + const filter = (stat, filepath, filename) => (path.extname(filename) !== '.js'); // Ensure to exists fs.mkdirSync(dest, {recursive: true}); // Try to copy the assets over try { // @todo: why doesn't the below work for PLD? - fs.copySync(src, dest, {filter}); - // make any sh script executable + copydir.sync(src, dest, filter); require('./make-executable')(_(fs.readdirSync(dest)) .filter(file => path.extname(file) === '.sh') .value() @@ -32,7 +32,7 @@ module.exports = (src, dest = os.tmpdir()) => { // Try to take corrective action fs.unlinkSync(f); - fs.copySync(src, dest, {filter}); + copydir.sync(src, dest, filter); require('./make-executable')(_(fs.readdirSync(dest)) .filter(file => path.extname(file) === '.sh') .value()