mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-04 23:12:15 +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
|
# Delete the line in the authorized_keys file
|
||||||
sed -i "/${repositoryName}/d" "${authorized_keys}"
|
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."
|
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
|
else
|
||||||
# Delete the line in the authorized_keys file
|
# Delete the line in the authorized_keys file
|
||||||
sed -i "/${repositoryName}/d" "${authorized_keys}"
|
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."
|
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
|
fi
|
|
@ -46,7 +46,7 @@ export default async function handler(req, res) {
|
||||||
//Find the absolute path of the shells directory
|
//Find the absolute path of the shells directory
|
||||||
const shellsDirectory = path.join(process.cwd(), '/helpers');
|
const shellsDirectory = path.join(process.cwd(), '/helpers');
|
||||||
//Exec the shell
|
//Exec the shell
|
||||||
const { stderr } = await exec(
|
const { stdout, stderr } = await exec(
|
||||||
`${shellsDirectory}/shells/deleteRepo.sh ${repoList[indexToDelete].repositoryName}`
|
`${shellsDirectory}/shells/deleteRepo.sh ${repoList[indexToDelete].repositoryName}`
|
||||||
);
|
);
|
||||||
if (stderr) {
|
if (stderr) {
|
||||||
|
|
Loading…
Reference in a new issue