Skip to content

Instantly share code, notes, and snippets.

View castortech's full-sized avatar

castortech

  • Castor Technologies
View GitHub Profile
@castortech
castortech / restore_xattr.ts
Created October 14, 2024 13:31
Modified version to restore extended attributes on Supabase storage.
import 'dotenv/config'
import { SupabaseClient, createClient } from '@supabase/supabase-js'
import * as fs from 'fs/promises'
import * as path from 'path'
import { exec } from 'child_process'
import { promisify } from 'util'
const execAsync = promisify(exec);
async function setFileMetadata(filePath: string, key: string, value: string): Promise<void> {
try {