mirror of
https://github.com/yt-dlp/ejs.git
synced 2026-06-13 00:32:11 +00:00
Use pnpm binary if available (#35)
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -113,10 +113,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Install Deno v2.x (latest)
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
- uses: pnpm/action-setup@v4 # respects packageManager version in package.json
|
||||
- name: Install requirements
|
||||
run: |
|
||||
python pnpm.py install --frozen-lockfile
|
||||
@@ -143,6 +140,10 @@ jobs:
|
||||
path: |
|
||||
src/yt/solver/test/players
|
||||
key: test-player-js-${{ hashFiles('src/yt/solver/test/tests.ts') }}
|
||||
- name: Install Deno v2.x (latest)
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
- name: Download player JS files
|
||||
run: |
|
||||
deno run \
|
||||
|
||||
10
pnpm.py
10
pnpm.py
@@ -43,7 +43,11 @@ def build_pnpm():
|
||||
package_manager = data["packageManager"]
|
||||
env = os.environ.copy()
|
||||
|
||||
if deno := shutil.which("deno"):
|
||||
if pnpm := shutil.which("pnpm"):
|
||||
name = "pnpm binary"
|
||||
cmd = [pnpm]
|
||||
|
||||
elif deno := shutil.which("deno"):
|
||||
name = "deno"
|
||||
env["DENO_NO_UPDATE_CHECK"] = "1"
|
||||
cmd = [
|
||||
@@ -65,10 +69,10 @@ def build_pnpm():
|
||||
else:
|
||||
return None, None
|
||||
|
||||
def pnpm(args: list[str]):
|
||||
def run_pnpm(args: list[str]):
|
||||
return subprocess.check_call([*cmd, *args], env=env)
|
||||
|
||||
return name, pnpm
|
||||
return name, run_pnpm
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user