8000 feat!: add filtering to different commands by alexis-moins · Pull Request #7 · alexis-moins/pm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat!: add filtering to different commands #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
watch:
@bashly generate --watch
bashly generate --watch

build:
@bashly generate --env=production --upgrade
bashly generate --env=production --upgrade

re:
@bash uninstall.sh && bash install.sh
bash uninstall.sh && bash install.sh
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align='center'>

![Version](https://img.shields.io/badge/version-1.8.3-blue.svg)
![Version](https://img.shields.io/badge/version-1.8.4-blue.svg)

</div>

Expand Down Expand Up @@ -37,10 +37,10 @@ After installing, you can follow these steps to quickly see how it works:
pm space add personal

# You can then create new projects in this space
pm new -s personal -n react-app
pm new personal/react-app

# pm supports project creation using templates
pm new -s personal -n react-app -t vite
pm new personal/react-app --template=vite

# But also creating your own one
pm template new python-poetry
Expand All @@ -49,10 +49,10 @@ pm template new python-poetry
pm open personal/react-app

# But using a different backend is also possible
pm open -s personal -n react-app -b vscode
pm open personal/react-app --backend=vscode

# You can even clone github repositories directly
pm clone git@github.com:alexis-moins/dot.git -s work -n dot
pm clone git@github.com:alexis-moins/dot.git --space=work --name=dot
```

## 🚦 Usage
Expand All @@ -67,19 +67,17 @@ Usage:
pm [COMMAND] --help | -h
pm --version | -v

Commands:
completions Generate bash completions
cd Open pm home in a new shell
space Add, list and filter spaces
template Template related commands
backend Backend related commands

Project Commands:
new Create a new empty project
clone Clone a remote git repository
open Open a project
filter Filter projects
list List projects
new Create a new empty project
clone Clone a remote git repository
open Open a project
filter Filter projects
list List projects

Commands:
space Add, list and filter spaces
template Template related commands
backend Backend related commands

Options:
--help, -h
Expand All @@ -93,10 +91,6 @@ Environment Variables:
Directory where the projects will be managed
Default: ~/dev

PM_BACKEND
Name of the backend used to open projects
Default: tmux

PM_BACKEND_SHOW_CMD
Command used to show backends
Default: cat
Expand Down
20 changes: 15 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ GREEN="\e[32;1m"

destination="${1:-"${HOME}/.local/bin"}"

# Install templates and backends
./pm install-hook
# Path were pm stores its templates and backends
PM_DATA_DIR="${HOME}/.local/share/pm"

if [[ ! -f "${destination}/pm" ]]; then
command cp -i pm "${destination}/pm"
fi
[[ ! -d "${PM_DATA_DIR}" ]] && command mkdir -p "${PM_DATA_DIR}"

# Copy default templates and backends
command cp -R backends "${PM_DATA_DIR}/"
command cp -R templates "${PM_DATA_DIR}/"

# Sets the default global template
echo "default" > "${PM_DATA_DIR}/global-template"

# Sets the default global backend
echo "vscode" > "${PM_DATA_DIR}/global-backend"

[[ ! -f "${destination}/pm" ]] && command cp -i pm "${destination}/pm"

echo -e "${GREEN}✓${WHITE} pm is ready to use"
Loading
0