diff --git a/package.json b/package.json index bda9a26f12..9feca07dcd 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "debug-unit": "node --inspect-brk test/test.js", "test-doclint": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js", "test": "npm run lint --silent && npm run coverage && npm run test-doclint && node utils/testrunner/test/test.js", - "install": "node -e \"try { require('./install-development.js'); } catch(e) { }\"", + "prepare": "node prepare.js", "lint": "([ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts ./src || eslint --ext js,ts ./src) && npm run tsc && npm run doc", "doc": "node utils/doclint/cli.js", "coverage": "cross-env COVERAGE=true npm run unit", diff --git a/install-development.js b/prepare.js similarity index 94% rename from install-development.js rename to prepare.js index fa1cfee176..2ada94891e 100644 --- a/install-development.js +++ b/prepare.js @@ -15,7 +15,7 @@ * limitations under the License. */ - // This file is only run when someone clones the github repo for development + // This file is only run when someone installs via the github repo try { console.log('Building playwright...'); @@ -56,6 +56,7 @@ async function downloadAndCleanup(browser) { // Remove previous revisions. const playwright = require('.')[browser]; const fetcher = playwright._createBrowserFetcher(); + const localRevisions = await fetcher.localRevisions(); const cleanupOldVersions = localRevisions.filter(revision => revision !== revisionInfo.revision).map(revision => fetcher.remove(revision)); await Promise.all([...cleanupOldVersions]);