Comparing version 2.3.85 to 2.3.86
{ | ||
"name": "netget", | ||
"version": "2.3.85", | ||
"version": "2.3.86", | ||
"description": "Rette Adepto/ Recibido Directamente.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
//configureDefaultServerBlock.js | ||
import fs from 'fs'; | ||
import chalk from 'chalk'; | ||
import inquirer from 'inquirer'; | ||
import defaultServerBlock from './defaultServerBlock.js'; | ||
import inquirer from 'inquirer'; | ||
import { execShellCommand } from '../../utils/execShellCommand.js'; | ||
@@ -38,3 +37,3 @@ export const configureDefaultServerBlock = async (userConfig) => { | ||
case 'sudo': | ||
tryElevatedPrivileges(path, data); | ||
await tryElevatedPrivileges(path, data); | ||
break; | ||
@@ -50,11 +49,12 @@ case 'manual': | ||
const tryElevatedPrivileges = (path, data) => { | ||
// Proper escaping of data to be echoed | ||
const tryElevatedPrivileges = async (path, data) => { | ||
const escapedData = escapeDataForShell(data); | ||
const command = `echo '${escapedData}' | sudo tee ${path} > /dev/null && sudo systemctl reload nginx`; | ||
execShellCommand(command).then(() => { | ||
const command = `echo '${escapedData}' | sudo tee ${path} > /dev/null`; | ||
try { | ||
await execShellCommand(command); | ||
console.log(chalk.green('Successfully configured NGINX with elevated privileges.')); | ||
}).catch(error => { | ||
} catch (error) { | ||
console.error(chalk.red(`Failed with elevated privileges: ${error.message}`)); | ||
}); | ||
displayManualInstructions(path, data); | ||
} | ||
}; | ||
@@ -61,0 +61,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
873306