mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
Compare commits
6 Commits
2aa9f4e839
...
9d6b99206a
| Author | SHA1 | Date | |
|---|---|---|---|
|
9d6b99206a
|
|||
|
d19a33f4f0
|
|||
|
9c7d395c6b
|
|||
|
2f9c68acfb
|
|||
|
df109c3803
|
|||
|
cbe53484fa
|
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"proseWrap": "always"
|
||||
"printWidth": 100
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
proseWrap: always
|
||||
printWidth: 120
|
||||
2
dev-env
2
dev-env
@@ -154,7 +154,7 @@ mkdir $HOME/Pictures >/dev/null 2>&1
|
||||
mkdir -p $XDG_DATA_HOME/clipse/tmp_files
|
||||
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
|
||||
copy $DEV_ENV/env/.markdownlint.jsonc $HOME/.markdownlint.jsonc
|
||||
copy $DEV_ENV/env/.prettierrc.yaml $HOME/.prettierrc.yaml
|
||||
copy $DEV_ENV/env/.prettierrc $HOME/.prettierrc
|
||||
|
||||
mkdir -p $XDG_DATA_HOME/applications/icons
|
||||
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
|
||||
|
||||
4
env/.config/git/config
vendored
4
env/.config/git/config
vendored
@@ -30,6 +30,7 @@
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
recurseSubmodules = on-demand
|
||||
|
||||
[fetch]
|
||||
prune = true
|
||||
@@ -65,3 +66,6 @@
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
2
env/.config/nvim
vendored
2
env/.config/nvim
vendored
Submodule env/.config/nvim updated: 688f83f433...8b40ff8c00
107
env/.local/scripts/swift-dev
vendored
Executable file
107
env/.local/scripts/swift-dev
vendored
Executable file
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||
IMAGE="git.housh.dev/michael/swift-dev-container"
|
||||
IMAGE_TAG="latest"
|
||||
|
||||
declare cmd dir pull_flag run_flag
|
||||
cmd=""
|
||||
dir=""
|
||||
pull_flag="0"
|
||||
run_flag="1"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Runs neovim inside swift-dev-container docker container for working on swift projects.
|
||||
|
||||
Currently I'm unable to get swift to install on arch linux, so this gives me working lsp, etc.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <command> -- <docker comand>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
-p | --pull: Used with run command, to pull/update image before running.
|
||||
-t | --tag <tag>: Used with run command to specify the image tag to use.
|
||||
|
||||
COMMANDS:
|
||||
pull <tag>: Pull the dev container image, tag is optional (default; 'latest').
|
||||
run <dir> (default): Run the dev container in the directory, if directory not supplied it
|
||||
will default to PWD.
|
||||
|
||||
NOTES:
|
||||
Run command is implied / default, so it's not required to be passed if you just want to run the
|
||||
container. For example in your swift project directory you can run 'swift-dev' and a container
|
||||
will start.
|
||||
|
||||
This will properly mount '~/.config/nvim' and '~/.local/share/nvim' inside the container.
|
||||
|
||||
If you would like to run a custom command / not run neovim in the container then it MUST follow
|
||||
'--'. For example, 'swift-dev -- /bin/bash'.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
pull() {
|
||||
log "Pulling image: '$IMAGE:$IMAGE_TAG'"
|
||||
podman pull "$IMAGE:$IMAGE_TAG"
|
||||
}
|
||||
|
||||
run() {
|
||||
[[ -z $dir ]] && dir="$PWD"
|
||||
[[ -z $cmd ]] && cmd="/root/.local/share/bob/nvim-bin/nvim"
|
||||
log "Running '$IMAGE:$IMAGE_TAG', in: '$dir'"
|
||||
podman run -it --rm \
|
||||
--volume "$XDG_CONFIG_HOME/nvim":/root/.config/nvim \
|
||||
--volume "$XDG_DATA_HOME/nvim":/root/.local/share/nvim \
|
||||
--volume "$dir":/root/dev \
|
||||
"$IMAGE:$IMAGE_TAG" "$cmd"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-p" ]] || [[ $1 == "--pull" ]]; then
|
||||
pull_flag="1"
|
||||
elif [[ $1 == "-t" ]] || [[ $1 == "--tag" ]]; then
|
||||
[[ -n ${2:-""} ]] || (log --error "Must supply a tag" && exit 1)
|
||||
IMAGE_TAG=$2
|
||||
shift
|
||||
elif [[ $1 == "pull" ]]; then
|
||||
run_flag="0"
|
||||
pull_flag="1"
|
||||
elif [[ $1 == "--" ]]; then
|
||||
shift
|
||||
cmd="$*"
|
||||
elif [[ ! $1 == "run" ]]; then
|
||||
dir="$1"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $pull_flag = "1" ]] && pull
|
||||
[[ $run_flag = "1" ]] && run
|
||||
Reference in New Issue
Block a user