From 9feab8687cf6b44b9f793b3dee737cdc1d6721e2 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Fri, 26 Aug 2022 18:10:29 +0530 Subject: [PATCH 1/2] Add script to init git before husky init --- bin/git-init.sh | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 bin/git-init.sh diff --git a/bin/git-init.sh b/bin/git-init.sh new file mode 100755 index 00000000..3792f571 --- /dev/null +++ b/bin/git-init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# check if git is initialized already +if [ -d .git ]; then + echo "Git is already initialized" + exit 0 +fi + +git init +git add --all . +git commit -m "Initialize project using rtCamp/theme-elementary" diff --git a/package.json b/package.json index 4f7e6398..ec6d3feb 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "lint:php:fix": "./bin/phpcbf.sh", "lint:package-json": "wp-scripts lint-pkg-json --ignorePath .gitignore", "lint:staged": "lint-staged", - "prepare": "husky install && npm run init", + "prepare": "npm run init && ./bin/git-init.sh && husky install", "start": "wp-scripts start", "test": "npm-run-all --parallel test:*", "test:js": "wp-scripts test-unit-js --config=tests/js/jest.config.js --passWithNoTests", From 9893a03691d75cb52ef8adb2f61517f9e153b8c4 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Fri, 26 Aug 2022 18:13:49 +0530 Subject: [PATCH 2/2] Update composer project setup command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5804b39a..c2f5865b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ A [Block based](https://developer.wordpress.org/block-editor/how-to-guides/theme ### Method 1 (Recommended) ``` -composer create-project rtcamp/elementary . --stability="dev" +composer create-project rtcamp/elementary [folder_name] ``` This command is equivalant of cloning the repository and running `composer install && npm install`