Skip to content

Commit

Permalink
fix: fix husky pre-push in new projects not obtaining parameters corr…
Browse files Browse the repository at this point in the history
…ectly
  • Loading branch information
alanrodas committed May 5, 2024
1 parent c51d58c commit 0a4e131
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ echo "";

# Run all the tests
echo "Running tests";
npx --no nps test;
npx --no -- nps test;

exit 0;
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## <small>0.8.5 (2024-05-05)</small>




## <small>0.8.4 (2024-05-05)</small>

- style: change casing of submodules to be uppercase always ([b2798a6](https://github.com/gobstones/gobstones-scripts/commit/b2798a6))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gobstones/gobstones-scripts",
"version": "0.8.4",
"version": "0.8.5",
"description": "Scripts to abstract away build configuration of Gobstones Project's libraries and modules.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion project-types/NonCode/package-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {},
"devDependencies": {
"@gobstones/gobstones-scripts": "^0.8.4",
"@gobstones/gobstones-scripts": "^0.8.5",
"husky": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion project-types/cliLibrary/package-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"commander": "^11.1.0"
},
"devDependencies": {
"@gobstones/gobstones-scripts": "^0.8.4",
"@gobstones/gobstones-scripts": "^0.8.5",
"husky": "^8.0.2"
}
}
4 changes: 2 additions & 2 deletions project-types/common/husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ echo "";

# Run license
echo "\nAdd license text to code files\n";
npx --no gobstones-scripts run license --silent ;
npx --no -- gobstones-scripts run license --silent ;

# Run prettify
echo "Run prettify\n";
npx --no -- gobstones-scripts run prettify --silent ;

# Run changelog
echo "\nRun changelog\n";
npx --no gobstones-scripts run changelog --silent ;
npx --no -- gobstones-scripts run changelog --silent ;

# Add all generated files
echo "\nAdd generated files to commit\n";
Expand Down
27 changes: 22 additions & 5 deletions project-types/common/husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,29 @@ REMOTE_NAME=$1;
REMOTE_URL=$2;
# Read the input and split it approprietly
INPUT=$(cat);
INPUT_ARR=($INPUT);
COUNTER=0;
for WORD in $INPUT; do
case $COUNTER in
0)
LOCAL_REF=$WORD;;
1)
LOCAL_OBJ_NAME=$WORD;;
2)
REMOTE_REF=$WORD;;
3)
REMOTE_OBJ_NAME=$WORD;;
esac
COUNTER=$((COUNTER + 1))
done

LOCAL_REF=${INPUT_ARR[0]}
LOCAL_OBJ_NAME=${INPUT_ARR[1]}
REMOTE_REF=${INPUT_ARR[2]}
REMOTE_OBJ_NAME=${INPUT_ARR[3]}
case "$LOCAL_REF" in
refs\/tags*)
# Apply specific code when publishing tags
IS_TAG=1;;
*)
# Apply specific code when publishing any branch
IS_TAG=0;;
esac

# Set failing on command fail, and undefined variable use
set -eu;
Expand Down
2 changes: 1 addition & 1 deletion project-types/library/package-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@gobstones/gobstones-core": "^0.4.7"
},
"devDependencies": {
"@gobstones/gobstones-scripts": "^0.8.4",
"@gobstones/gobstones-scripts": "^0.8.5",
"husky": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion project-types/reactLibrary/package-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@gobstones/gobstones-scripts": "^0.8.4",
"@gobstones/gobstones-scripts": "^0.8.5",
"husky": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion src/Config/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @group Internal: Values
*/
export const version = '0.8.4';
export const version = '0.8.5';

/**
* The tool's test server address.
Expand Down

0 comments on commit 0a4e131

Please sign in to comment.