[READ-ONLY] Mirror of https://github.com/usrrname/dotfiles. There was an attempt to store my configs
shovelware nix-pkgs nix
0

Configure Feed

Select the types of activity you want to include in your feed.

Add initial setup scripts and configuration for testing environment

- Created .gitmodules to include Bats testing framework and its dependencies.
- Added package.json and package-lock.json for managing Bats and its related packages.
- Implemented setup.sh for installing Homebrew and specified packages with a dry-run option.
- Introduced Bats test files to validate the setup script functionality.
- Updated .zshrc to include direnv plugin and modified local ignore settings.
- Added global .gitignore for editor-specific files and directories.

Jen Chan (Jul 15, 2025, 12:52 PM -0300) 27042010 c138ec14

+119 -7
+9
.gitmodules
··· 1 + [submodule "test/bats"] 2 + path = test/bats 3 + url = https://github.com/bats-core/bats-core.git 4 + [submodule "test/test_helper/bats-assert"] 5 + path = test/test_helper/bats-assert 6 + url = https://github.com/bats-core/bats-assert.git 7 + [submodule "test/test_helper/bats-support"] 8 + path = test/test_helper/bats-support 9 + url = https://github.com/bats-core/bats-support.git
+4 -5
.stow-local-ignore
··· 2 2 \.DS_Store 3 3 .DS_Store 4 4 .git 5 - .vscode 6 5 .gitignore 7 - .env.d.ts 8 - .env.schema 6 + .vscode 9 7 \.git 10 8 \.gitignore 11 9 README.* 12 10 LICENSE 13 - \.DS_Store 14 - .env 11 + .env 12 + test/* 13 + setup.sh
+2
git/.gitconfig
··· 8 8 9 9 [core] 10 10 editor = vi 11 + excludesFile = ~/.gitignore_global 11 12 12 13 [gpg] 13 14 format = ssh ··· 20 21 21 22 [push] 22 23 autoSetupRemote = true 24 + 23 25 [init] 24 26 defaultBranch = main
+9
git/.gitignore_global
··· 1 + # Direnv files 2 + .direnv 3 + .envrc 4 + 5 + # Editor specific files and folders 6 + .idea 7 + .vscode 8 + .cursorrules 9 + .cursor
+22
package-lock.json
··· 1 + { 2 + "name": ".dotfiles", 3 + "lockfileVersion": 3, 4 + "requires": true, 5 + "packages": { 6 + "": { 7 + "devDependencies": { 8 + "bats": "^1.12.0" 9 + } 10 + }, 11 + "node_modules/bats": { 12 + "version": "1.12.0", 13 + "resolved": "https://registry.npmjs.org/bats/-/bats-1.12.0.tgz", 14 + "integrity": "sha512-1HTv2n+fjn3bmY9SNDgmzS6bjoKtVlSK2pIHON5aSA2xaqGkZFoCCWP46/G6jm9zZ7MCi84mD+3Byw4t3KGwBg==", 15 + "dev": true, 16 + "license": "MIT", 17 + "bin": { 18 + "bats": "bin/bats" 19 + } 20 + } 21 + } 22 + }
+11
package.json
··· 1 + { 2 + "name": "@usrrname/dotfiles", 3 + "scripts": { 4 + "test": "bats test/setup.bats" 5 + }, 6 + "devDependencies": { 7 + "bats": "^1.12.0", 8 + "bats-assert": "^2.2.0", 9 + "bats-support": "^0.3.0" 10 + } 11 + }
+32
setup.sh
··· 1 + #!/bin/zsh 2 + 3 + declare -a PKGS=("direnv" "1password" "cursor" "docker" "google-chrome" "iterm2" "slack" "spotify" "zoom") 4 + 5 + # Check for dry-run mode 6 + DRY_RUN=${DRY_RUN:-false} 7 + 8 + # Check if Homebrew is installed 9 + if ! command -v brew &> /dev/null; then 10 + echo "Installing Homebrew..." 11 + if [[ "$DRY_RUN" == "true" ]]; then 12 + echo "[DRY RUN] Would install Homebrew" 13 + else 14 + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | zsh 15 + fi 16 + else 17 + echo "Homebrew already installed" 18 + fi 19 + 20 + echo "Installing packages..." 21 + for PKG in "${PKGS[@]}"; do 22 + if [[ "$DRY_RUN" == "true" ]]; then 23 + echo "[DRY RUN] Would install $PKG" 24 + elif brew list --cask "$PKG" &> /dev/null; then 25 + echo "$PKG is already installed" 26 + else 27 + echo "Installing $PKG" 28 + brew install --cask "$PKG" 29 + fi 30 + done 31 + 32 + echo "Setup complete!"
+26
test/setup.bats
··· 1 + #!/usr/bin/env bats 2 + 3 + setup() { 4 + load 'test_helper/bats-assert/load' 5 + load 'test_helper/bats-support/load' 6 + } 7 + 8 + @test "can run script in dry-run mode" { 9 + DRY_RUN=true run ./setup.sh 10 + assert_success 11 + assert_output --partial 'Installing packages...' 12 + assert_output --partial 'Setup complete!' 13 + # Should contain either "Installing Homebrew..." or "Homebrew already installed" 14 + assert_output --regexp '(Installing Homebrew\.\.\.|Homebrew already installed)' 15 + } 16 + 17 + @test "script handles existing homebrew" { 18 + # This test assumes you have homebrew installed 19 + if command -v brew &> /dev/null; then 20 + DRY_RUN=true run ./setup.sh 21 + assert_success 22 + assert_output --partial 'Homebrew already installed' 23 + else 24 + skip "Homebrew not installed" 25 + fi 26 + }
+4 -2
zsh/.zshrc
··· 48 48 # Custom plugins may be added to $ZSH_CUSTOM/plugins/ 49 49 # Example format: plugins=(rails git textmate ruby lighthouse) 50 50 # Add wisely, as too many plugins slow down shell startup. 51 - plugins=(git zsh-autosuggestions zsh-autocomplete 1password gh) 51 + plugins=(git zsh-autocomplete 1password gh direnv) 52 52 53 53 source $ZSH/oh-my-zsh.sh 54 54 ··· 127 127 alias pint='./vendor/bin/pint' 128 128 129 129 # nektos/act 130 - alias act='act --container-architecture linux/amd64' 130 + alias act='act --container-architecture linux/amd64' 131 + 132 + eval "$(direnv hook zsh)"