1 Commits

Author SHA1 Message Date
Morten Olsen
e6fe8336de fix: reenable auto ID 2024-01-16 09:13:21 +01:00
3 changed files with 3 additions and 3 deletions

View File

@@ -127,7 +127,7 @@ jobs:
cache: '${{ env.NODE_CACHE }}'
node-version: '${{ env.NODE_VERSION }}'
scope: '${{ env.NODE_SCOPE }}'
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v3
with:
name: lib
path: ./

View File

@@ -1,7 +1,7 @@
import { z } from 'zod';
const setLoadSchema = z.object({
id: z.string(),
id: z.string().optional(),
name: z.string().optional(),
script: z.string(),
});

View File

@@ -60,7 +60,7 @@ class LoadRepo extends EventEmitter<LoadRepoEvents> {
public set = async (options: SetLoadOptions) => {
const { database } = this.#options;
const db = await database.instance;
const id = options.id || nanoid();
const id = options.id || `auto-id/${nanoid()}`;
const script = createHash('sha256').update(options.script).digest('hex');
const scriptDir = resolve(this.#options.config.files.data, 'scripts');
await mkdir(scriptDir, { recursive: true });