diff --git a/helpers/shells/deleteRepo.sh b/helpers/shells/deleteRepo.sh index e4652c5..62ca7ad 100755 --- a/helpers/shells/deleteRepo.sh +++ b/helpers/shells/deleteRepo.sh @@ -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 \ No newline at end of file diff --git a/pages/api/repo/id/[slug]/delete.js b/pages/api/repo/id/[slug]/delete.js index e9b2738..1e574f9 100644 --- a/pages/api/repo/id/[slug]/delete.js +++ b/pages/api/repo/id/[slug]/delete.js @@ -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) {