Lowercase the circuit name.

pull/4512/head
Evan Sangaline 9 months ago committed by Aniket
parent 8372e6dee0
commit 82b1a2f2bf
  1. 7
      libs/remix-ws-templates/src/script-templates/sindri/index.ts

@ -75,15 +75,14 @@ export const sindriScripts = async (plugin: any) => {
break
}
// Derive the circuit name from the workspace name.
const {name: workspaceName} = await plugin.call('filePanel', 'getCurrentWorkspace')
sindriManifest.name =
workspaceName
.replace(/\s*-+\s*\d*$/, '')
.replace(/[^a-zA-Z0-9]+/g, '-')
.replace(/^[^a-zA-Z]+/, '') || `my-${sindriManifest.circuitType}-circuit`
// Remove any unsupported characters from the circuit name.
sindriManifest.name = (sindriManifest.name || '').replace(/[^-a-zA-Z0-9_]+/g, '-')
.replace(/^[^a-zA-Z]+/, '')
.toLowerCase() || `my-${sindriManifest.circuitType}-circuit`
// Write out the modified manifest file.
writeIfNotExists('sindri.json', JSON.stringify(sindriManifest, null, 2))

Loading…
Cancel
Save