Skip to content

Commit

Permalink
chore(repo): Temporarily disable pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosdouvlis committed Nov 3, 2023
1 parent 7c3cfb3 commit 69711e1
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

##############################
# Determine Staged Packages
##############################

staged_files=$(git diff --name-only --cached --diff-filter=ACM)

# Initialize an empty string to hold the unique folder paths
unique_folders=""

# Loop through each staged file
for file in $staged_files; do
# Extract the first two folders from the file path
folder=$(echo $file | awk -F'/' '{print $1 "/" $2}')

# Filter files which end with .mjs, .js, .jsx, .ts, or .tsx [NOTE: Should match ./.lintstagedrc.json]
if [[ $file =~ \.(mjs|js|jsx|ts|tsx)$ ]]; then
# Check if this folder is already in the list of unique folders
if [[ $folder == packages/* ]] && [[ ! " $unique_folders " =~ "$folder" ]]; then
# Append the folder to the list of unique folders
unique_folders="$unique_folders --filter={./$folder}^..."
fi
fi
done

##############################
# Build Staged Packages
##############################

if [ -n "$unique_folders" ]; then
npx turbo run build --output-logs=errors-only $unique_folders
else
echo "SKIPPING: No packages to build"
fi
###############################
## Determine Staged Packages
###############################
#
#staged_files=$(git diff --name-only --cached --diff-filter=ACM)
#
## Initialize an empty string to hold the unique folder paths
#unique_folders=""
#
## Loop through each staged file
#for file in $staged_files; do
# # Extract the first two folders from the file path
# folder=$(echo $file | awk -F'/' '{print $1 "/" $2}')
#
# # Filter files which end with .mjs, .js, .jsx, .ts, or .tsx [NOTE: Should match ./.lintstagedrc.json]
# if [[ $file =~ \.(mjs|js|jsx|ts|tsx)$ ]]; then
# # Check if this folder is already in the list of unique folders
# if [[ $folder == packages/* ]] && [[ ! " $unique_folders " =~ "$folder" ]]; then
# # Append the folder to the list of unique folders
# unique_folders="$unique_folders --filter={./$folder}^..."
# fi
# fi
#done
#
###############################
## Build Staged Packages
###############################
#
#if [ -n "$unique_folders" ]; then
# npx turbo run build --output-logs=errors-only $unique_folders
#else
# echo "SKIPPING: No packages to build"
#fi

##############################
# Run Lint Staged
Expand Down

0 comments on commit 69711e1

Please sign in to comment.