mirror of
https://github.com/unraid/api.git
synced 2026-05-06 23:20:30 -05: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");
|
.digest("hex");
|
||||||
console.log(`TXZ SHA256: ${sha256}`);
|
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 };
|
return { txzSha256: sha256, txzName };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -379,8 +379,11 @@ else
|
|||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
if [ "$CHOWN" = "y" ]; then
|
if [ "$CHOWN" = "y" ]; then
|
||||||
find . -type d -exec chmod -v 755 {} \;
|
# Set strict mode and fail if commands fail
|
||||||
find . -type d -exec chown -v root:root {} \;
|
set -e
|
||||||
|
find . -type d -exec sudo chmod 755 {} + || exit 1
|
||||||
|
find . -type d -exec sudo chown 0:0 {} + || exit 1
|
||||||
|
set +e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure that the 'root' of the package is chmod 755 because
|
# Ensure that the 'root' of the package is chmod 755 because
|
||||||
|
|||||||
Reference in New Issue
Block a user