From 7c7d2c3cda0d412f1a99be1923cdbb852d78682e Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 28 Oct 2023 18:13:08 +0700 Subject: [PATCH] Enable dotglob by default --- package.json | 2 +- src/executor/runner.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a8986cb..ada937c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "domcloud-bridge", - "version": "0.31.0", + "version": "0.31.1", "description": "Deployment runner for DOM Cloud", "main": "app.js", "engines": { diff --git a/src/executor/runner.js b/src/executor/runner.js index 76c5e57..a2fa5fb 100644 --- a/src/executor/runner.js +++ b/src/executor/runner.js @@ -709,6 +709,7 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, } } if (config.source || config.commands) { + await sshExec(`shopt -s dotglob`, false); await sshExec(`export DOMAIN='${subdomain}'`, false); await sshExec(`mkdir -p ${subdomaindata['Home directory']}/public_html && cd "$_"`); } @@ -737,7 +738,7 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, } } } - let executedCMD = [`shopt -s dotglob`, `rm -rf *`]; + let executedCMD = [`rm -rf *`]; let executedCMDNote = ''; if (source.url === 'clear') { // we just delete them all @@ -770,7 +771,7 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, } if (url.pathname.endsWith('.tar.gz')) { executedCMD.push(`wget -O _.tar.gz ` + escapeShell(url.toString())); - executedCMD.push(`tar -xvzf _.tar.gz ; rm _.tar.gz ; chmod -R 0750 *`); + executedCMD.push(`tar -xzf _.tar.gz ; rm _.tar.gz ; chmod -R 0750 *`); } else { executedCMD.push(`wget -O _.zip ` + escapeShell(url.toString())); executedCMD.push(`unzip -q -o _.zip ; rm _.zip ; chmod -R 0750 *`); @@ -781,7 +782,6 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec, } executedCMDNote = 'Downloading files'; } - executedCMD.push(`shopt -u dotglob`); if (firewallOn) { await iptablesExec.setDelUser(domaindata['Username']); }