From 271031fa72be001851e444a269359a39f0500f36 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 2 Jan 2025 03:47:44 +0530 Subject: [PATCH] Fixed documentation and reduced hardcoding of upstream repo-owner's name. --- CHANGELOG.md | 4 ++++ Extras.md | 2 +- GettingStarted-Advanced.md | 2 +- README.md | 3 +-- scripts/approve-fingerprint-sudo.sh | 7 ++++--- scripts/fresh-install-of-osx.sh | 6 +++--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5b0551..1caa88c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ As documented in the README's [adopting](README.md#how-to-adoptcustomize-the-scr For those who follow this repo, here's the changelog for ease of adoption: +### 1.0-40 + +* Fixed documentation and reduced hardcoding of upstream repo-owner's name. + ### 1.0-39 * Introduced [a new script](scripts/cleanup-browser-profiles.sh) to cleanup browser profiles folders. diff --git a/Extras.md b/Extras.md index f534a14..a0ccb2d 100644 --- a/Extras.md +++ b/Extras.md @@ -44,7 +44,7 @@ The config file for this script is a yaml file that is passed into this script a ```yaml - folder: "${PROJECTS_BASE_DIR}/oss/git_scripts" - remote: https://github.com/vraravam/git_scripts.git + remote: https://github.com/vraravam/git_scripts other_remotes: upstream1: upstream2: diff --git a/GettingStarted-Advanced.md b/GettingStarted-Advanced.md index 6754ad2..f4e2293 100644 --- a/GettingStarted-Advanced.md +++ b/GettingStarted-Advanced.md @@ -13,4 +13,4 @@ This portion of the script will setup the home folder repo, the browser profiles * Setup the preferences and keyboard shortcuts as per your preferences. (I have setup for Clipboard history, Window management and Import/Export of the Raycast settings.) *Hint:* If you had exported the configs into a file and had captured it as part of your home git repo, then simply re-importing will be sufficient on the new machine. -Back to the [readme](README.md#advanced-setup-in-addition-to-the-basic-setup-if-you-want-to-capture-other-files-in-an-encrypted-private-git-repo) +Back to the [readme](README.md#basic-setup) diff --git a/README.md b/README.md index 860f376..6829363 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ - [How to test changes in your fork before raising a Pull Request](#how-to-test-changes-in-your-fork-before-raising-a-pull-request) - [Pre-requisites](#pre-requisites) - [Basic setup](#basic-setup) -- [Advanced setup (in addition to the basic setup if you want to capture other files in an encrypted private git repo)](#advanced-setup-in-addition-to-the-basic-setup-if-you-want-to-capture-other-files-in-an-encrypted-private-git-repo) - [Finally...](#finally) - [Ongoing tasks to keep your backup up-to-date on a regular basis](#ongoing-tasks-to-keep-your-backup-up-to-date-on-a-regular-basis) - [Extras/Details](#extrasdetails) @@ -26,7 +25,7 @@ If you want to be able to re-image a new machine with your own settings (and ove In your forked repo, make the following changes, commit and push *via the Github web-UI itself* (for the first time before running the scripts). Once the above steps are done, and committed into your fork, then everytime you need to run the setup, you can run the `curl` commands that point to *your* fork: -1. **_Only in this file, `GettingStarted-Basic.md` and `files/--HOME--/.shellrc` files (and nowhere else):_** Find and replace the strings that reference my usernames to your equivalent ones (for eg, you can search for `vraravam` and `avijayr` and replace them with your values). +1. **_Only in this file, `GettingStarted-Basic.md` and `files/--HOME--/.shellrc` files (and nowhere else):_** Find and replace the strings that reference my usernames to your equivalent ones (for eg, you can search for `vraravam` (the `GH_USERNAME` env var) and `avijayr` (the `KEYBASE_USERNAME` env var) and replace them with your values). 2. ***Optional:*** The nested folder names that you choose for your setup (as referred to by `PROJECTS_BASE_DIR`, `PERSONAL_CONFIGS_DIR`, `PERSONAL_PROFILES_DIR`, `PERSONAL_BIN_DIR`, and `DOTFILES_DIR` in the `files/--HOME--/.shellrc` file) **should be reflected** in the folder structure of the nested folders in the `files` directory of the committed github repo itself. For eg, I have `PROJECTS_BASE_DIR="${HOME}/dev"`, and if your setup uses `workspace` instead of `dev`, then, in your forked repository, the folder name `files/dev` should be renamed to `files/workspace` and so on. 3. Review all entries in the `${HOME}/Brewfile`, and ensure that there are no unwanted libraries/applications. If you have any doubts (if comparing with my [Brewfile](files/--HOME--/Brewfile)), you will need to search the internet for the uses of those libraries/applications and decide whether to keep it or not. diff --git a/scripts/approve-fingerprint-sudo.sh b/scripts/approve-fingerprint-sudo.sh index aa4e6de..3aee8cb 100755 --- a/scripts/approve-fingerprint-sudo.sh +++ b/scripts/approve-fingerprint-sudo.sh @@ -7,15 +7,16 @@ # Copied from: https://apple.stackexchange.com/a/466029 type is_file &> /dev/null 2>&1 || source "${HOME}/.shellrc" +type warn &> /dev/null 2>&1 || source "${HOME}/.shellrc" -if ! ioreg -c AppleBiometricSensor | grep -q "AppleBiometricSensor"; then - warn "Touch ID hardware is not detected. Skipping configuration." +if ! ioreg -c AppleBiometricSensor | grep -q AppleBiometricSensor; then + warn 'Touch ID hardware is not detected. Skipping configuration.' return fi if ! is_file /etc/pam.d/sudo_local; then sudo sh -c 'sed "s/^#auth/auth/" /etc/pam.d/sudo_local.template > /etc/pam.d/sudo_local' - success "Created new file: /etc/pam.d/sudo_local" + success 'Created new file: /etc/pam.d/sudo_local' else warn "'/etc/pam.d/sudo_local' already present - not creating again" fi diff --git a/scripts/fresh-install-of-osx.sh b/scripts/fresh-install-of-osx.sh index 59a1a54..f67b61d 100755 --- a/scripts/fresh-install-of-osx.sh +++ b/scripts/fresh-install-of-osx.sh @@ -209,7 +209,7 @@ if is_non_zero_string "${DOTFILES_DIR}" && ! is_git_repo "${DOTFILES_DIR}"; then # Setup any sudo access password from cmd-line to also invoke the gui touchId prompt approve-fingerprint-sudo.sh - # Setup the DOTFILES_DIR repo's upstream if it doesn't already point to vraravam's repo + # Setup the DOTFILES_DIR repo's upstream if it doesn't already point to UPSTREAM_GH_USERNAME's repo git -C "${DOTFILES_DIR}" remote -vv | grep "${UPSTREAM_GH_USERNAME}" if [ $? -ne 0 ]; then git -C "${DOTFILES_DIR}" remote add upstream "https://github.com/${UPSTREAM_GH_USERNAME}/dotfiles" @@ -219,7 +219,7 @@ if is_non_zero_string "${DOTFILES_DIR}" && ! is_git_repo "${DOTFILES_DIR}"; then warn 'skipping setting new upstream remote for the dotfiles repo' fi else - warn "skipping cloning the dotfiles repo since '${DOTFILES_DIR}' is either not defined or is already present" + warn "skipping cloning the dotfiles repo since '${DOTFILES_DIR}' is either not defined or is already a git repo" fi ! is_non_zero_string "${HOMEBREW_PREFIX}" && error "'HOMEBREW_PREFIX' env var is not set; something is wrong. Please correct before retrying!" @@ -360,7 +360,7 @@ if is_non_zero_string "${KEYBASE_USERNAME}"; then clone_repo_into "$(build_keybase_repo_url "${KEYBASE_PROFILES_REPO_NAME}")" "${PERSONAL_PROFILES_DIR}" # Clone the natsumi-browser repo into the ZenProfile/Profiles/chrome folder and switch to the 'dev' branch - is_directory "${PERSONAL_PROFILES_DIR}/ZenProfile/Profiles/" && clone_repo_into "git@github.com:vraravam/natsumi-browser" "${PERSONAL_PROFILES_DIR}/ZenProfile/Profiles/chrome" dev + is_directory "${PERSONAL_PROFILES_DIR}/ZenProfile/Profiles/" && clone_repo_into "git@github.com:${UPSTREAM_GH_USERNAME}/natsumi-browser" "${PERSONAL_PROFILES_DIR}/ZenProfile/Profiles/chrome" dev else warn "skipping cloning of profiles repo since either the 'KEYBASE_PROFILES_REPO_NAME' or the 'PERSONAL_PROFILES_DIR' env var hasn't been set" fi