Skip to content

CosmicToast/zpe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Z Project Environments

Build Status (Drone)

A manager for your messy projects

Introduction

I have something like 30-50 repositories in my ~/Workspace. That is absolutely awful. At some point, I tried to subdivide them into "categories" like "dev", "sys", "alpine" and so on. That didn’t help much.

I clearly needed something to help me navigate around them, in a sort of "bookmark"ish way, and handle initial setup. So I accidentally wrote the SysV RC in zsh.

Installation

  1. Acquire zpe.zwc

    1. Download it from the GitHub releases page

    2. Use gmake with zsh installed to generate it from source

  2. Store it in a consistent location

  3. Add the file to your fpath (example: fpath+=( ~/.zsh/zpe.zwc ))

  4. Autoload all the contents of the digest file (example: autoload -w ~/.zsh/zpe.zwc)

Note
If you’re using the latest version of toasty-zsh, you can simply drop zpe.zwc into your $zd/digests folder.

Usage

zpe is the main function name. Everything is done through subcommands.

zpe new

Creates a new project environment. Effectively, this creates three new files inside $ZPE_DIR (name.up, name.down and name.env), and populates them with defaults. You also can optionally pass it a directory for the project in question. It defaults to the current working directory. Example: zpe new tzsh ~/Workspace/sys/toasty-zsh

zpe edit

Edits one of the three files created by zpe new. Defaults to editing name.up. Pass an extra parameter to give the suffix to edit. Example: zpe edit tzsh env

zpe load

Loads one of the following:

  • global configuration (zpe.conf)

  • name.env if only name is passed

  • name.ext if name and an ext is passed

    Example: zpe load tzsh down

zpe ls|list

Lists the projects in their "callable" form. Usually sorted, but not guaranteed to be such. If an argument is provided, it takes that to be a project name and lists the files under that project (e.g "up" and "down").

zpe cat

Prints the contents of a given project file.

zpe cp|copy

Copies project from argument 1 to argument 2. Best effort to translate variable names.

zpe mv|move

Renames project from argument 1 to argument 2. Best effort to translate variable names.

zpe exec

Runs a command in the context of a project. Example: zpe exec tzsh git pull

Warning
The parsing is simplistic: $1 is the project name and the other arguments are evaluated as-is.
zpe rm

Removes a project. More precisely, it removes $1.* from $ZPE_DIR. Example: zpe rm tzsh

zpe up|down

Convenience shortcuts for zpe load $1 up|down. Example: zpe up tzsh.

Releases

No releases published

Sponsor this project

Packages

No packages published