forked from baron/baron-sso
code-check 오류 수정
This commit is contained in:
@@ -6,8 +6,40 @@ job_name="${1:-adminfront-tests}"
|
||||
mkdir -p reports
|
||||
rm -rf adminfront/node_modules
|
||||
|
||||
playwright_install_cmd=(npx playwright install --with-deps)
|
||||
playwright_install_desc="npx playwright install --with-deps"
|
||||
is_port_available() {
|
||||
local port="$1"
|
||||
node -e '
|
||||
const net = require("net");
|
||||
const port = Number(process.argv[1]);
|
||||
const server = net.createServer();
|
||||
server.once("error", () => process.exit(1));
|
||||
server.once("listening", () => server.close(() => process.exit(0)));
|
||||
server.listen(port, "127.0.0.1");
|
||||
' "$port"
|
||||
}
|
||||
|
||||
find_available_port() {
|
||||
node -e '
|
||||
const net = require("net");
|
||||
const server = net.createServer();
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
const address = server.address();
|
||||
process.stdout.write(String(address.port));
|
||||
server.close();
|
||||
});
|
||||
'
|
||||
}
|
||||
|
||||
playwright_install_cmd=(npx playwright install)
|
||||
playwright_install_desc="npx playwright install"
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
playwright_install_cmd=(npx playwright install --with-deps)
|
||||
playwright_install_desc="npx playwright install --with-deps"
|
||||
elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
|
||||
playwright_install_cmd=(npx playwright install --with-deps)
|
||||
playwright_install_desc="npx playwright install --with-deps"
|
||||
fi
|
||||
|
||||
set +e
|
||||
(
|
||||
@@ -67,6 +99,11 @@ fi
|
||||
|
||||
set +e
|
||||
port="${PORT:-5180}"
|
||||
if ! is_port_available "$port"; then
|
||||
fallback_port="$(find_available_port)"
|
||||
echo "==> requested PORT=$port is already in use; switching to PORT=$fallback_port"
|
||||
port="$fallback_port"
|
||||
fi
|
||||
echo "==> adminfront using PORT=$port"
|
||||
(
|
||||
cd adminfront
|
||||
|
||||
Reference in New Issue
Block a user