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:
Eli Bosley
2025-02-21 15:14:15 -05:00
committed by GitHub
parent 08423b8dae
commit 46a05eb76d
2 changed files with 5 additions and 11 deletions

View File

@@ -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 };
};

View File

@@ -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