mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
fix: chown correctly (#1185)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated the approach to managing directory ownership for improved consistency across various environments. - Enhanced error handling in directory permission and ownership commands. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -150,15 +150,6 @@ const buildTxz = async (
|
||||
.digest("hex");
|
||||
console.log(`TXZ SHA256: ${sha256}`);
|
||||
|
||||
if (validatedEnv.SKIP_VALIDATION !== "true") {
|
||||
try {
|
||||
await $`${join(startingDir, "scripts/explodepkg")} "${txzPath}"`;
|
||||
} catch (err) {
|
||||
console.error(`Error: invalid txz package created: ${txzPath}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return { txzSha256: sha256, txzName };
|
||||
};
|
||||
|
||||
|
||||
@@ -379,8 +379,11 @@ else
|
||||
echo
|
||||
fi
|
||||
if [ "$CHOWN" = "y" ]; then
|
||||
find . -type d -exec chmod -v 755 {} \;
|
||||
find . -type d -exec chown -v root:root {} \;
|
||||
# Set strict mode and fail if commands fail
|
||||
set -e
|
||||
find . -type d -exec sudo chmod 755 {} + || exit 1
|
||||
find . -type d -exec sudo chown 0:0 {} + || exit 1
|
||||
set +e
|
||||
fi
|
||||
|
||||
# Ensure that the 'root' of the package is chmod 755 because
|
||||
|
||||
Reference in New Issue
Block a user