https://github.com/3rd/templates
Personal project templates.
https://github.com/3rd/templates
Last synced: 7 months ago
JSON representation
Personal project templates.
- Host: GitHub
- URL: https://github.com/3rd/templates
- Owner: 3rd
- Created: 2023-12-18T00:27:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T22:46:50.000Z (almost 2 years ago)
- Last Synced: 2025-06-28T06:42:04.259Z (10 months ago)
- Language: TypeScript
- Size: 513 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Templates
Sketchy templates for projects & sandboxes
### Scripts
tpl.sh
```sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# paths
CWD=$PWD
TEMPLATES_DIR=~/templates
pick_template() {
cd "$TEMPLATES_DIR"
fd . -td -d 1 | fzf
}
main() {
# select template
local selected_template source destination
selected_template=$(pick_template)
if [[ -z "$selected_template" ]]; then
exit
fi
source="$TEMPLATES_DIR/$selected_template"
echo "Source: $source"
# select destination
echo -n 'Destination: '
read -i "$CWD/" -e -r destination
# apply
if [ -d "$destination" ]; then
cp -r "$source""/*" "$destination"
else
cp -r "$source" "$destination"
fi
git init
}
main
```