diff --git a/libs/remix-ws-templates/src/script-templates/sindri/index.ts b/libs/remix-ws-templates/src/script-templates/sindri/index.ts index bcf90ca0a0..af0be38938 100644 --- a/libs/remix-ws-templates/src/script-templates/sindri/index.ts +++ b/libs/remix-ws-templates/src/script-templates/sindri/index.ts @@ -1,15 +1,23 @@ export const sindriScripts = async (plugin) => { - await plugin.call('fileManager', 'writeFile', - 'scripts/sindri/sindri.ts' , - // @ts-ignore - (await import('!!raw-loader!./sindri.ts')).default) + await plugin.call('fileManager', 'writeFile', + 'scripts/sindri/sindri.ts' , + // @ts-ignore + (await import('!!raw-loader!./sindri.ts')).default) - - await plugin.call('fileManager', 'writeFile', - 'sindri.json' , + // Only write out the `sindri.json` file if it doesn't already exist. + let sindriJsonExists: boolean + try { + await plugin.call('fileManager', 'readFile', './fake.json') + sindriJsonExists = true + } catch { + sindriJsonExists = false + } + if (!sindriJsonExists) { + await plugin.call('fileManager', 'writeFile', + 'sindri.json', // @ts-ignore (await import('raw-loader!./sindri.conf')).default) - - - await plugin.call('fileManager', 'open', 'scripts/sindri/sindri.ts') - } \ No newline at end of file + } + + await plugin.call('fileManager', 'open', 'scripts/sindri/sindri.ts') +}