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