Coder Social home page Coder Social logo

enrolzsh's Introduction

EnrolZSH

EnrolZSH is a dead simple zsh script, which provides you with simple deployment commands.

With the first release we introduce autoloading for specific projects. The commands are stored inside the project folder itself (enrol/deploy.zsh). This allows you do store all commands inside version control and makes sure all your coworkers are running the same script. In the next version we will improve this and ship some predefined commands. We'll also allow configuration on project basis. This will remove a lot of complexitity for the developer.

Requirements:

Installation:

  • Clone enrolzsh-plugin into ~/.oh-my-zsh/plugins/
  • Add enrolzsh to the plugins array inside ~/.zshrc.
plugins=(git enrolzsh)
  • Configure the global configuration file inside the enrolzsh plugin ~/.oh-my-zsh/plugins/enrolzsh/.enrolzsh_global.
  • Make sure your folder strucutre looks like this:
    • ER_VM_DIR: Base folder, where the virtual machine lives (e.g ScotchBox)
    • ER_PROJECT_DIR: The public of the VM (mostly .../public)
    • All projects are stored inside the ENROL_PROJECT_DIR
  • Create a enrol folder inside every project you create.
  • Add a deploy.zsh file inside the created enrol folder an add all your scripts there. A boilerplate is linked here: EnrolZSH Project Boilerplate
  • Make sure your current projects are stored inside the global settings. So you don't have to init the project every time.
    • Add a prefix and the directory at the bottom of .enrolzsh_global, like this: test="~/Projects/public/test"
    • Include the prefix inside the variable ER_AUTOLOAD
  • You're ready to go.

Important notes:

Operating system

Enrol supports Linux and MacOS. Windows works mostly iniside it's Unix subsystem, but is not tested and will fall short on certain commands like enrol.finder.

Custom enrol script:

When providing a custom enrol script inside the enrol-directory make sure to prefix variables when using so. Enrol will load your script inside the global context and this has potential for dramatic issues.

Available commands:

Make use of the great gloabing feature inside ZSH by making use of . Type enr and , then again and you will see all your possibilities.

  • enrol: Welcome screen

  • enrol --version: Get installed version

  • enrol --help: Help screen

  • enrol --update: Update enrol when via git, just works when you've cloned the enrolzsh.

  • enrol.projects: Loads all projects from the main project folder (defined inside the global settings) into the namespace. After this command it's possible to call the project via enrol.PROJECT (PROJECT = Folder name without TLD, if you used any). If you have a script called deploy.zsh inside the project it will also work during runtime. This command will do the same as autoload, but only at runtime of the terminal.

  • enrol.base: Return to configured base path.

  • enrol.reload: Reload zsh config - important after adjusting global config.

  • To make it easier for you to grasp all available project right of the but. Every autoloaded project will be accessible under enrol.PREFIX and will direct to the root directory of the project. Just type enrol. + TAB for autocompletion and search for your project.

Some shorthands for vagrant inside the defined VM folder:

  • enrol.vu: vagrant up
  • enrol.vh: vagrant halt
  • enrol.vr: vagrant reload
  • enrol.vs: vagrant ssh
  • enrol.vb: vagrant box update

Helper functions:

  • enrol.helper.finder: Open current directory in finder

Config functions:

  • enrol.config.global: Edit global settings directly in CMD (Nano)
  • enrol.config.finder: Open finder inside enrolzsh plugin directory (MacOS)

enrolzsh's People

Contributors

marcwieland95 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

j3ll3yfi5h

enrolzsh's Issues

Custom Plugin Directory change

  • enrol.config.global and enrol.config.finderare not working anymore.
  • Install guide is not correct anymore because zsh plugins should be installed inside the custom directory.

enrol.config.finder does not work on wsl

When I use the command "enrol.config.finder" I get "Konnte keinen Dateideskriptor finden, der auf die Konsole verweist.".

Are your commands also compatible to Bash on Windows Subsystem for Linux? ;)

Add enrol base path

To launch vagrant, we need a simple command to return into the base path

Something like enrol.base would be great.

Autoloading variables

A variable can only be used once in a global context across multiple projects, this is because of the autoloading functionality build into enrol.
This behaviour could be very dangerous when using variables inside a deploy.zsh file to simplify the script, because it's possible that the script is reading a variable from a complete different project.

Variables need to be encapsulated or prefixed. Best solution would be a automatic one inside the autoload feature itself.

Handle multiple enviroments

Let enrol handle multiple enviroments (base paths).

On base dir in ~/Project -> ScotchBox
On base dir in ~/LAMP -> Homestead
Multiple trellis instances inside ~/Code/DOMAIN

Add refresh command

After updating config, reload zsh without restarting application manually.

Create alias for autoloaded projects

I'd mostly type enrol. and then search for the project. But in this subcommand there are just enrol helper commands available. Would be nice, if there's an alias to the correct command.

Open finder from terminal

Sometimes it's very useful to not navigate into the folder structure manually.
Forcing finder to open automatically on the current project would be great.
open .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.