Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if file already exists and if so skip #159

Open
github-actions bot opened this issue Dec 29, 2023 · 0 comments
Open

check if file already exists and if so skip #159

github-actions bot opened this issue Dec 29, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link

check if file already exists and if so skip

// TODO check if file already exists and if so skip

import { join } from 'path';
import * as fs from 'fs/promises';
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_API_KEY);

const { data: shareables } = await supabase.from('record').select('*').eq('releasable', true);

const saveTo = join('..', '..', 'src', 'content', 'shareables');
shareables.forEach((shareable) => {
	// TODO check if file already exists and if so skip
	// TODO go over dates, maybe adjsut table and also generate dates in same format as others
	const { title, description, comment, category, url, created_at } = shareable;
	const content = `---
title: "${title}"
description: "${description.replace('"', "'")}"
tags: 

b8c532b9d4156c594c7fd27eac2f7d3168b24769

@github-actions github-actions bot added the todo label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants