Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jun 18, 2024
1 parent e808e4a commit 1accf16
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"type": "module",
"scripts": {
"submodules": "./submodules.sh",
"submodules": "tsx submodules",
"postinstall": "pnpm dlx husky install",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 pnpm --filter \"./packages/*\" build",
"build:examples": "cross-env NODE_OPTIONS=--max-old-space-size=16384 pnpm --filter \"./examples/*\" --parallel build",
Expand Down
15 changes: 0 additions & 15 deletions submodules.sh

This file was deleted.

13 changes: 13 additions & 0 deletions submodules.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { execSync } from 'child_process'

const GITHUB_TOKEN = process.env.GITHUB_TOKEN

if (GITHUB_TOKEN) {
console.log("Running in CI environment, using GITHUB_TOKEN for authentication")
execSync(`git config --global url.https://${GITHUB_TOKEN}@github.com/.insteadOf https://github.com`)
} else {
console.log("Running in local environment, using normal authentication")
}

execSync('git submodule update --init --recursive')
execSync('cd internal && git checkout main')

0 comments on commit 1accf16

Please sign in to comment.