Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update pipe permissions
Browse files- app/scripts/notion-importer/index.mjs +17 -0
- entrypoint.sh +4 -0
app/scripts/notion-importer/index.mjs
CHANGED
|
@@ -421,6 +421,23 @@ async function main() {
|
|
| 421 |
console.log('π§Ή Cleaning output directory to avoid conflicts...');
|
| 422 |
await cleanDirectory(config.output);
|
| 423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
if (config.mdxOnly) {
|
| 425 |
// Only convert existing Markdown to MDX
|
| 426 |
console.log('π MDX conversion only mode');
|
|
|
|
| 421 |
console.log('π§Ή Cleaning output directory to avoid conflicts...');
|
| 422 |
await cleanDirectory(config.output);
|
| 423 |
|
| 424 |
+
// Clean assets/image directory and ensure proper permissions
|
| 425 |
+
console.log('π§Ή Cleaning assets/image directory and setting permissions...');
|
| 426 |
+
if (existsSync(ASTRO_ASSETS_PATH)) {
|
| 427 |
+
await cleanDirectory(ASTRO_ASSETS_PATH);
|
| 428 |
+
} else {
|
| 429 |
+
ensureDirectory(ASTRO_ASSETS_PATH);
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
// Ensure proper permissions for assets directory
|
| 433 |
+
const { execSync } = await import('child_process');
|
| 434 |
+
try {
|
| 435 |
+
execSync(`chmod -R 755 "${ASTRO_ASSETS_PATH}"`, { stdio: 'inherit' });
|
| 436 |
+
console.log(' β
Set permissions for assets/image directory');
|
| 437 |
+
} catch (error) {
|
| 438 |
+
console.log(' β οΈ Could not set permissions (non-critical):', error.message);
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
if (config.mdxOnly) {
|
| 442 |
// Only convert existing Markdown to MDX
|
| 443 |
console.log('π MDX conversion only mode');
|
entrypoint.sh
CHANGED
|
@@ -3,6 +3,10 @@ set -e
|
|
| 3 |
|
| 4 |
echo "π Starting Hugging Face Space..."
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Check if Notion import is enabled and token is available
|
| 7 |
if [ "${ENABLE_NOTION_IMPORT:-false}" = "true" ] && [ -n "$NOTION_TOKEN" ] && [ -n "$NOTION_PAGE_ID" ]; then
|
| 8 |
echo "π Notion import enabled - fetching content from Notion..."
|
|
|
|
| 3 |
|
| 4 |
echo "π Starting Hugging Face Space..."
|
| 5 |
|
| 6 |
+
# Ensure proper permissions for the app directory at runtime
|
| 7 |
+
echo "π§ Setting up permissions..."
|
| 8 |
+
chmod -R 755 /app/src/content/assets 2>/dev/null || echo "β οΈ Could not set permissions (non-critical)"
|
| 9 |
+
|
| 10 |
# Check if Notion import is enabled and token is available
|
| 11 |
if [ "${ENABLE_NOTION_IMPORT:-false}" = "true" ] && [ -n "$NOTION_TOKEN" ] && [ -n "$NOTION_PAGE_ID" ]; then
|
| 12 |
echo "π Notion import enabled - fetching content from Notion..."
|