Skip to content

Commit 36a1376

Browse files
laulujanSleeplessByte
authored andcommitted
Add message if ENV does not matches package.json prettier version
1 parent 8c3ef84 commit 36a1376

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/pr-check

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,15 @@ if (!envIsThruthy('SKIP_INTEGRITY', false)) {
138138
// Cleanup tmp directory if any exists
139139
cleanUp();
140140

141-
/**Check if prettier version of package.json is the same than ENV in workflow,
142-
* if not set ENV equal to package.json version
141+
/**
142+
* Check if prettier version of package.json is the same than ENV in workflow
143143
*/
144144
const packageFile = shell.cat('package.json').toString();
145145
let package = JSON.parse(packageFile);
146-
const packageVersion = package['devDependencies']['prettier']
146+
const packageVersion = package['devDependencies']['prettier'].replace(/[^0-9a-zA-Z.]/g, '')
147147

148-
if (shell.env['EXERCISM_PRETTIER_VERSION'] != packageVersion){
149-
shell.echo('\n==========\nCheck prettier package.json and ENV variable match \n');
150-
shell.env['EXERCISM_PRETTIER_VERSION'] = packageVersion;
148+
if (shell.env['EXERCISM_PRETTIER_VERSION'] !== packageVersion){
149+
shell.echo(`\n==========\nWorkflow EXERCISM_PRETTIER_VERSION does not match pacakge.json prettier version ${packageVersion}\n`);
151150
}
152151

153152

0 commit comments

Comments
 (0)