Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b87d58ab authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Format shell scripts

- ./generate_filters.sh
parent 13bb4354
Loading
Loading
Loading
Loading
Loading

format_script.sh

0 → 100755
+27 −0
Original line number Diff line number Diff line
#!/bin/bash

# Check if shfmt is installed
if ! command -v shfmt &>/dev/null; then
  echo "shfmt is not installed. Please install shfmt (curl -sS https://webi.sh/shfmt | sh) to fix formatting."
  exit 0
fi

# Get the directory of the script
SCRIPT_DIR="$(cd "$(dirname "$0")"/ && pwd)"

# Use git to list all shell scripts (respects .gitignore)
FILES=$(git -C "$SCRIPT_DIR" ls-files --cached --others --exclude-standard '*.sh')

if [[ -z "$FILES" ]]; then
  echo "No shell scripts found to format."
  exit 0
fi

# Format each file
for script_file in $FILES; do
  echo "Formatting $script_file ..."
  shfmt -w -i 2 "$SCRIPT_DIR/$script_file"
  git add "$SCRIPT_DIR/$script_file"
done

echo "Formatting complete!"
+19 −19
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ PROJECT_PATH=$(echo -n "e/os/browser" | jq -sRr @uri)
for tag in $(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/repository/tags" | jq -r '.[].name'); do
  echo "Checking tag: $tag"

    pipeline_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines?ref=${tag}&status=success" \
        | jq -r '.[0].id')
  pipeline_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines?ref=${tag}&status=success" |
    jq -r '.[0].id')

  if [ "$pipeline_id" != "null" ] && [ -n "$pipeline_id" ]; then
    echo "Found successful pipeline for tag $tag (Pipeline ID: $pipeline_id)"
@@ -25,8 +25,8 @@ fi

echo "Looking for build-cromite-x64 job in pipeline $pipeline_id..."

job_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines/${pipeline_id}/jobs" \
    | jq -r '.[] | select(.name=="build-cromite-x64") | .id')
job_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines/${pipeline_id}/jobs" |
  jq -r '.[] | select(.name=="build-cromite-x64") | .id')

if [ -z "$job_id" ]; then
  echo "No job named build-cromite-x64 found in pipeline $pipeline_id"
+15 −13
Original line number Diff line number Diff line
@@ -7,8 +7,10 @@ while getopts "uc" opt; do
  case $opt in
  u) DO_UNINSTALL=true ;;
  c) DO_CLEAR=true ;;
    *) echo "Usage: $0 [-u] [-c]" >&2
       exit 1 ;;
  *)
    echo "Usage: $0 [-u] [-c]" >&2
    exit 1
    ;;
  esac
done

+6 −7
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

root_dir=$(dirname "$(readlink -f "$0")")


branch=$(grep 'cromite_branch' versions.txt | awk -F'"' '{print $2}')

cd $root_dir/build
+6 −7
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

root_dir=$(dirname "$(readlink -f "$0")")


branch=$(grep 'ungoogled_chromium_branch' versions.txt | awk -F'"' '{print $2}')

cd $root_dir/domain_substitution
+38 −38

File changed.

Contains only whitespace changes.

+205 −205

File changed.

Contains only whitespace changes.

+18 −18

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

Loading