Initial Commit

This commit is contained in:
Pratik Tripathy
2024-02-08 23:13:12 +05:30
commit 44ccbbfe6e
2 changed files with 60 additions and 0 deletions

48
10x_project_access.sh Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
op() {
local chosen_project
chosen_project="$(find -L ~/Code -mindepth 2 -maxdepth 2 -not -path '*/.*' -printf "%T@ %p\n" | sort -nr | cut -d ' ' -f 2- | fzf --prompt='Select a project: ')"
# Do nothing and return if user cancelled out
if [ -z "$chosen_project" ]; then
return 0
fi
cd "$chosen_project" || return
nvim
}
pnew(){
local directory
directory="$(find -L ~/Code/ -mindepth 1 -maxdepth 1 -not -path '*/.*' -type d | sed '/Squbix\|KeepWorks\|Supra/d' | sort | fzf --prompt='In which directory? ')"
# Do nothing and return if user cancelled out
if [ -z "$directory" ]; then
return 0
fi
local project_name
if [ -n "$1" ]; then
project_name="$1"
else
project_name=$(find -L "$directory" -mindepth 1 -maxdepth 1 -not -path '*/.*' -type d | fzf --print-query -e +i --prompt='Project name (AVOID EXISTING ONES BELOW): ' | head -1)
fi
if [ -z "$project_name" ]; then
echo "You did not chose a project name!!!"
return 1
fi
if [ -d "$directory/$project_name" ]; then
echo "$directory/$project_name project already exists"
echo "Try again"
return 1
# TODO: Should allow to reenter the name
fi
[ -d "$directory/$project_name" ] || mkdir -p "$directory/$project_name" || return
cd "$directory/$project_name" || return
nvim
}

12
Readme.md Normal file
View File

@@ -0,0 +1,12 @@
# Increase (My) Dev Productivity
- A list of scripts to automate my daily development activities
## Note to Self
- Scripts should be symlinked to $XDG_CONFIG_HOME/shell/ directory
- ~/.profile should source everything inside $XDG_CONFIG_HOME/shell
- Keep them as portable as possible
1. Across all *nic OS
2. Across sh, bash, zsh