-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_folders.zsh
More file actions
executable file
·87 lines (78 loc) · 2.87 KB
/
create_folders.zsh
File metadata and controls
executable file
·87 lines (78 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env zsh
#
# create_folders.zsh
# ----------------------------------------------------------------------------
# This script sets up the folder structure for your dotfiles repository and
# creates minimal default "dotfiles" if they don't already exist.
#
# Usage:
# chmod +x create_folders.zsh
# ./create_folders.zsh
#
# ----------------------------------------------------------------------------
# Directory Structure:
#
# dotfiles/
# ├── config
# │ ├── git
# │ │ ├── ignore (global gitignore)
# │ │ └── config (optional global .gitconfig or partial config)
# │ ├── starship.toml (example for starship prompt)
# │ └── other-tool (e.g. other CLI tool config)
# ├── zsh
# │ ├── macos
# │ │ ├── .zshrc
# │ │ └── .zprofile
# │ ├── linux
# │ │ ├── .zshrc
# │ │ └── .zprofile
# │ └── oh-my-posh.json
# ├── windows
# │ ├── bootstrap_windows.ps1
# │ └── (optional) profile.ps1
# ├── scripts
# │ ├── bootstrap_mac.zsh
# │ ├── bootstrap_linux.zsh
# ├── .devcontainer
# │ ├── devcontainer.json
# │ └── Dockerfile
# ├── install.zsh
# ├── install.ps1
# ├── bootstrap.zsh
# ├── README.md
# └── .gitignore
#
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Fail immediately on error, and treat unset variables as an error
# ----------------------------------------------------------------------------
set -euo pipefail
echo "Creating folder structure for your repo..."
# ----------------------------------------------------------------------------
# Determine Script Directory
# ----------------------------------------------------------------------------
SCRIPT_DIR="$( cd "$( dirname "${(%):-%x}" )" && pwd )"
# ----------------------------------------------------------------------------
# Create Folders
# ----------------------------------------------------------------------------
# Root-level directories
mkdir -p "$SCRIPT_DIR/zsh"
mkdir -p "$SCRIPT_DIR/windows"
mkdir -p "$SCRIPT_DIR/config"
mkdir -p "$SCRIPT_DIR/scripts"
mkdir -p "$SCRIPT_DIR/.devcontainer"
# Subdirectories for ZSH
mkdir -p "$SCRIPT_DIR/zsh/macos"
mkdir -p "$SCRIPT_DIR/zsh/linux"
# Optional directories for additional configs/tools
mkdir -p "$SCRIPT_DIR/config/git"
mkdir -p "$SCRIPT_DIR/config/other-tool"
# Optional directories if you use these technologies
mkdir -p "$SCRIPT_DIR/vscode"
mkdir -p "$SCRIPT_DIR/ruby"
mkdir -p "$SCRIPT_DIR/psql"
# ----------------------------------------------------------------------------
# Summary
# ----------------------------------------------------------------------------
echo "Folder structure set up successfully!"
exit 0