-
Notifications
You must be signed in to change notification settings - Fork 187
fix: use universal shebangs for better portability #2127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
82dc3c7
c5f9fbb
dfd3f9a
5dda393
aae7d27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| # https://stackoverflow.com/a/14203146 | ||
| for i in "$@"; do | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| GIT_REV=$(git show-ref main --heads -s) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| cd "../cli" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| fly deploy -a product-api --dockerfile ./docker/products.Dockerfile | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| fly secrets set -a product-api GRAPH_API_TOKEN="$GRAPH_API_TOKEN" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| clickhouse client -n <<-EOSQL | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Exit on any error | ||
| set -e | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| cd ../.. && make full-demo-down | ||
| cd ../.. && make full-demo-down |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| cd ../.. && make full-demo-up | ||
| cd ../.. && make full-demo-up |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Install WunderGraph CLI | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| . ../../scripts/configurations/kubernetes.sh | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Install WunderGraph CLI | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| GIT_REV=$(git rev-parse --short HEAD) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| # js composition | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| # js composition | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| rm -rf cosmo | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| rm -rf ../plugins | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Delete the demo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| cd "../router" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| cd "../cli" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| export COSMO_API_KEY=cosmo_669b576aaadc10ee1ae81d9193425705 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| export COSMO_API_KEY=cosmo_669b576aaadc10ee1ae81d9193425705 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Delete the demo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainShebang portability LGTM Switching to env-based bash improves cross-distro portability (macOS, BSD, Nix, Guix, containers). No functional impact here. To ensure no hardcoded /bin/bash shebangs remain, run: 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
rg -n '^\#\!\s*/bin/bash(\s|$)' || echo "No /bin/bash shebangs left"Length of output: 209 Shebang portability LGTM – update verification regex File: scripts/delete-kubernetes-demo.sh Shebang portability LGTM To ensure there are no remaining hardcoded #!/usr/bin/env bash
set -euo pipefail
rg -n '^#!\s*/bin/bash(\s|$)' || echo "No /bin/bash shebangs left"🤖 Prompt for AI Agents |
||
| set -e | ||
|
|
||
| # Create and publish a demo federated graph based on the subgraphs in the demo folder | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| # Delete the demo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| cd "../router" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| echo "" | ||
| echo "Setting up keycloak and seeding the database ..." | ||
|
|
@@ -22,6 +22,12 @@ make create-cli-demo | |
|
|
||
| echo "Demo project created successfully." | ||
|
|
||
| # Ensure wgc is available in PATH | ||
| if ! command -v wgc &> /dev/null; then | ||
| export NPM_CONFIG_PREFIX="${NPM_CONFIG_PREFIX:-$HOME/.npm-global}" | ||
| export PATH="$NPM_CONFIG_PREFIX/bin:$PATH" | ||
| fi | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think its better to move changes to wgc to a separate commit. (Just my suggestions, I just came across this pr and not a contributor to this repo) |
||
| token=$(wgc router token create mytoken --graph-name mygraph --namespace default -r) | ||
|
|
||
| echo '' | ||
|
|
@@ -46,4 +52,4 @@ echo "" | |
| echo "Login: [email protected]" | ||
| echo "Password: wunder@123" | ||
| echo "" | ||
| echo "To see the playground of the router, navigate to http://localhost:3002" | ||
| echo "To see the playground of the router, navigate to http://localhost:3002" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Variables | ||
| envFilename='.env.production' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.