summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/tools/clean.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'remote/test/puppeteer/tools/clean.mjs')
-rwxr-xr-xremote/test/puppeteer/tools/clean.mjs18
1 files changed, 18 insertions, 0 deletions
diff --git a/remote/test/puppeteer/tools/clean.mjs b/remote/test/puppeteer/tools/clean.mjs
new file mode 100755
index 0000000000..aa4ba516b1
--- /dev/null
+++ b/remote/test/puppeteer/tools/clean.mjs
@@ -0,0 +1,18 @@
+#!/usr/bin/env node
+
+/**
+ * @license
+ * Copyright 2022 Google Inc.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import {exec} from 'child_process';
+import {readdirSync} from 'fs';
+
+exec(
+ `git clean -Xf ${readdirSync(process.cwd())
+ .filter(file => {
+ return file !== 'node_modules';
+ })
+ .join(' ')}`
+);