From 6eb451ecaf4cb79485aa200e326c12e49da404be Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 7 Feb 2024 09:51:32 +0100 Subject: [PATCH] fix(run): refs#6706 keep option to keep container on failure --- myt-run.js | 11 +++++++---- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/myt-run.js b/myt-run.js index cd85ea2..5731aaf 100644 --- a/myt-run.js +++ b/myt-run.js @@ -20,7 +20,8 @@ class Run extends Command { ci: 'Workaround for continuous integration system', network: 'Docker network to attach container to', random: 'Whether to use a random container name and port', - tmpfs: 'Whether to use tmpfs mount for MySQL data' + tmpfs: 'Whether to use tmpfs mount for MySQL data', + keep: 'Keep container on failure' } }; @@ -29,12 +30,14 @@ class Run extends Command { ci: 'c', network: 'n', random: 'r', - tmpfs: 't' + tmpfs: 't', + keep: 'k' }, boolean: [ 'ci', 'random', - 'tmpfs' + 'tmpfs', + 'keep' ] }; @@ -208,7 +211,7 @@ class Run extends Command { return server; } catch (err) { try { - await ct.rm({force: true}); + if (!opts.keep) await ct.rm({force: true}); } catch (e) {} throw err; } diff --git a/package-lock.json b/package-lock.json index 8b9dead..aeef553 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@verdnatura/myt", - "version": "1.6.4", + "version": "1.6.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@verdnatura/myt", - "version": "1.6.4", + "version": "1.6.6", "license": "GPL-3.0", "dependencies": { "@sqltools/formatter": "^1.2.5", diff --git a/package.json b/package.json index 77b225c..6e5762a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@verdnatura/myt", - "version": "1.6.5", + "version": "1.6.6", "author": "Verdnatura Levante SL", "description": "MySQL version control", "license": "GPL-3.0",