Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #83 from theodo/fix-release-script-5
Browse files Browse the repository at this point in the history
fix: fix release script (5)
  • Loading branch information
ThomasAribart authored Jul 29, 2022
2 parents 2e4de7c + f582b54 commit 48225e2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/setPackagesVersions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { readdirSync, readFileSync } from 'fs';
import { readdirSync, readFileSync, writeFileSync } from 'fs';
import { join } from 'path';

const newVersionTag = process.argv[2] as string | undefined;

console.log('newVersionTag', newVersionTag);

const semanticVersioningRegex =
/^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;

Expand All @@ -16,10 +14,8 @@ if (
}

const NEW_VERSION = newVersionTag.slice(1);
console.log('NEW_VERSION', NEW_VERSION);

const VERSION_MAJOR = (newVersionTag.match(semanticVersioningRegex) ?? [])[1];
console.log('VERSION_MAJOR', VERSION_MAJOR);

type PackageJson = {
version?: string;
Expand Down Expand Up @@ -55,5 +51,5 @@ packagesNames.forEach(packageName => {
}
});

// writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
});

0 comments on commit 48225e2

Please sign in to comment.