Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 21, 2024
1 parent 17f0c6f commit cff35a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/delete-playwright-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
* these changes would not be reflected in the test-runner. This script (hooked to nodemon) makes sure that
* whenever you change the csf-playwright-plugin.ts file, the cache is cleared and you actually get your changes.
*/
if (process.platform !== 'darwin') {
throw new Error('This script only works on macOS.');
}

const fs = require('fs').promises;
const path = require('path');

Expand Down Expand Up @@ -62,6 +58,10 @@ async function findPlaywrightTransformCacheDir(dirPath) {
// This is the pattern used by Playwright: /var/folders/{some-hash}/{some-other-hash}/T/playwright-transform-cache-501
// it will look like this /var/folders/sv/lg8lnv0s4gg6_rt7s6cd52qr0000gn/T/playwright-transform-cache-501
const main = async () => {
if (process.platform !== 'darwin') {
throw new Error('This script only works on macOS.');
}

let playwrightTransformPath = await getCachedPath();

if (!playwrightTransformPath) {
Expand All @@ -81,4 +81,6 @@ const main = async () => {
}
};

main();
if (process.env.CI === undefined) {
main();
}

0 comments on commit cff35a9

Please sign in to comment.