repo: Update README and even update some scripts

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-04-06 18:13:45 +08:00
parent b4f4e843b4
commit a0cafdc320
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
3 changed files with 47 additions and 6 deletions

View File

@ -7,7 +7,7 @@ working at The Pins Team, see [our dotfiles][df-gl].
## Getting Started
### Using the bootstraper script
### Using the bootstraper script without cloning
```sh
## configure required variables
@ -21,12 +21,18 @@ $(command -v curl>>/dev/null && echo curl -o- || echo wget -q0-) https://raw.git
unset GH_USERNAME GH_PAT
```
### With Cloning the Repo
```sh
```
## Want to fork me owo?
Follow the checklist below after forking to ensure no
references to mine are found. **Remember that your fork,
your problem.** It's up to you on how do you customize
stuff.
Follow the checklist below after forking to ensure no references to mine are found. **Remember that your fork, your problem.** It's
up to you on how do you customize stuff. You can use [The Pins Team's dotfiles template][template] to start from our template.
[template]: https://github.com/MadeByThePinsHub/dotfiles-template
* [ ] Customize the `bootstrap-linux.sh` into your needs.
* [ ] Delete any existing dotfiles I made (e.g. `*.gitconfig`, `*.bashrc`, etc.) and do `bin/backup-dotfiles`. That script will move your current config into your `.dotfiles` local repo and do soft links.

View File

@ -5,7 +5,7 @@ if [[ -f "$PWD/.git/config" ]] && [[ $1 != "" ]]; then
git remote --verbose add upstream $UPSTREAM_REPO_URL || git remote --verbose set-url upstream $UPSTREAM_REPO_URL
git fetch --all
elif [[ ! -f "$PWD/.git/config" ]]; then
echo "Is this an git repository? I doubt."
echo "Is this an git repository? I doubt." && exit 1
else
echo "Usage: ${0} <git-url>"
fi

35
bin/rename-branch Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
doCheckStatusHere() {
GIT_STATUS=$(echo $?)
if [[ $GIT_STATUS != "0" ]]; then
echo "error: Failed to run because it exited with a non-zero code."
exit 1
else
return 0
fi
}
if [[ $1 != "" && $2 == "" ]]; then
OLD_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
NEW_BRANCH_NAME=$1
# we're gonna do some error handling here
git status>>/dev/null
doCheckStatusHere
git branch -m $NEW_BRANCH_NAME
git push -u origin $NEW_BRANCH_NAME
echo "info: I didn't delete the old branch name, just in case you need it."
echo "info: To delete the old branch both locally and in remote, run the following command:"
echo "info: git branch --d $OLD_BRANCH_NAME && git push origin :$OLD_BRANCH_NAME "
exit
elif [[ $GIT_STATUS == "0" ]] && [[ $1 != "" && $2 != "" ]]; then
echo $1 && echo $2
exit
elif [[ $GIT_STATUS != "1" ]]; then
echo "error: Is this an git repository? I doubt." && exit 1
else
echo "Usage: ${0} <new-branch-name> [target-branch-optionally-to-rename"
fi