mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-05-15 20:16:50 +02:00
fix: improve delete repo function
This commit is contained in:
parent
100c62f39b
commit
941fd93653
|
@ -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
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue