tfrere HF Staff commited on
Commit
118982c
Β·
1 Parent(s): 1f4b96e

update pipe permissions

Browse files
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..."