Git Product home page Git Product logo

dsh's Introduction

DSH

Dashing you to wherever you need to be (in the cli).

-> The Problem

  • Have you ever felt like ls and cd-ing in the shell took too much time even though its mostly muscle memory? You're working on one project and would like to jump on over to another one without having to trudge through using cd ...

slowly cd-ls

slow and steasy I guess.

-> The solution

  • Quick and easy cli tool that lets you hop around saved lanes (up to 5 only).

superfastquickafdsh

DSH-ING THROUGH

Notes

This is my first project and also my CS50 Final Project!

Installation

Important Note: This was made for macBook on arm64 and I havent had the time to compile a separate version for windows

  • Install by using git clone and cloning it into a directory.

  • Copy and paste the code below into your .zshrc or .bashrc file and replace "path/to/" with the path directory where you cloned the repo to.

export DASH_CACHE="path/to/dash/cache/lanes.txt"
export PATH="$PATH:path/to/dash"

dsh(){
    operate=$1
    position=$2
    nextposition=$3

    if [[ $operate < 5 ]]; then
        directory=$(dasher $operate)
        if [[ $? == 0 ]]; then
            cd $directory
        fi
    elif [[ $# -eq 0 ]]; then
        dasher
    else
        dasher $operate $position $nextposition
    fi
}
  • hopefully I learn how to make my own install scripts soon :p

All about DSH

  1. Lanes & [lane index]
  • Lanes are just the path to directory saved on dsh, while [lane index] is the position or number mapped to the lane.
  1. dsh a
  • Simple add function that adds the current working directory, the same path you'd get if you'd inputted pwd into the terminal, to dsh.

  • It takes 0 arguments.

  1. dsh rm
  • Removes a [lane index] and it's corresponding lane from dsh.

  • Removes only 1 [lane index] at a time.

  1. dsh ls
  • Lists all currently saved lanes and their corresponding [lane index] in ascending order.
  1. dsh mv
  • Moves a [lane index] to a new index.

  • If the new index already has a lane attached to it, the command will still run and replace the lane's [lane index] with the moved [lane index].

  1. dsh \[lane index]
  • Changes the current working directory to whatever lane is stored in [lane index].

Pretty simple, borderline CRUD application honestly.

Going through what I learnt and the problems I faced building This

dsh's People

Contributors

leeian1011 avatar

Stargazers

M Haidar Hanif avatar Andrew NS Yeow avatar fyezool avatar

Watchers

 avatar

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.