diff --git a/tools/scripts/publish.mjs b/tools/scripts/publish.mjs index 16698d1..0edec28 100644 --- a/tools/scripts/publish.mjs +++ b/tools/scripts/publish.mjs @@ -25,7 +25,7 @@ function invariant(condition, message) { let [, , name, version, tag] = process.argv; console.log('get version: %s, tag: %s', version, tag); -version = version.replace(/^core@/, ''); +version = version.replace(new RegExp(`^${name}@`), ''); // A simple SemVer validation to validate the version const validVersion = /^\d+\.\d+\.\d+(-\w+\.\d+)?/;