fix: improve delete repo function

This commit is contained in:
Ravinou 2023-09-10 18:14:46 +02:00
parent 100c62f39b
commit 941fd93653
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7
2 changed files with 1 additions and 3 deletions

View file

@ -40,10 +40,8 @@ if [ -d "$1" ]; then
# Delete the line in the authorized_keys file
sed -i "/${repositoryName}/d" "${authorized_keys}"
echo -n "The folder "${pool}/${repositoryName}" and all its data have been deleted. The line associated in the authorized_keys file has been deleted."
exit 3
else
# Delete the line in the authorized_keys file
sed -i "/${repositoryName}/d" "${authorized_keys}"
echo -n "The folder "${pool}/${repositoryName}" did not exist (repository never initialized or used). The line associated in the authorized_keys file has been deleted."
exit 3
fi

View file

@ -46,7 +46,7 @@ export default async function handler(req, res) {
//Find the absolute path of the shells directory
const shellsDirectory = path.join(process.cwd(), '/helpers');
//Exec the shell
const { stderr } = await exec(
const { stdout, stderr } = await exec(
`${shellsDirectory}/shells/deleteRepo.sh ${repoList[indexToDelete].repositoryName}`
);
if (stderr) {