Skip to content

A simple script to switch directory quickly for powershell, bash and zsh

License

Notifications You must be signed in to change notification settings

ACupofAir/Directory-Stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Directory-Stack

A powershell module to switch directory quickly

⚙️ Install

powershell user

  • Install from PowerShell Gallery(Suggestion)

    • Install-Module -Name directory-stack
  • Update from PowerShell Gallery(Suggestion)

    • Update-Module -Name directory-stack
    • [TODO] It seems that you need to manually go to the directory and remove the old version files for the updated module to take effect.
  • Install mannual

    • download this repository: git clone [email protected]:ACupofAir/Directory-Stack.git and rename it to directory-stack
    • reference the folder in you powershell profile($PROFILE is the default powershell config filek) , add this line to the profile Import-Module -Name $repository_path -DisableNameChecking
  • Optional Config: set alias of the function names in your $PROFILE to use them easily

    # in $PROFILE(usually is "~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1")
    Set-Alias -Name dv Get-Dir-Stack
    Set-Alias -Name pd Add-Dir-Item
    Set-Alias -Name pp Remove-Dir-Stack-Item
    Set-Alias -Name jp Set-Stacked-Dir

bash or zsh user

curl -sSL https://raw.githubusercontent.com/ACupofAir/Directory-Stack/main/bash/install.sh | bash

🧰 Usage

powershell user

Following usage will run rightly after config alias in $PROFILE

  • [TODO] show be update. demo
cmd info
pd pushd current directory in the stack
pd $DIR_NAME pushd $DIR_NAME in the stack
pp $DIR_INDEX popd directory index $DIR_INDEX in stack out
dv show the table of stack(named from the linux command dirs -v), and waiting for user to input the index of directory want to go
jp $DIR_INDEX jump to the directory whose index is $DIR_INDEX in the stack

bash or zsh user

cmd info
pd pushd current directory in the stack
pd $DIR_NAME pushd $DIR_NAME in the stack
pp $DIR_INDEX popd directory index $DIR_INDEX in stack out and jump to the directory
rmd $DIR_INDEX remove directory index $DIR_INDEX in stack
dv show the table of stack(named from the linux command dirs -v)
jp $DIR_INDEX jump to the directory whose index is $DIR_INDEX in the stack
cldirs temporarily clear stack, when you start a new stack, the directory stack will be restored

📅 Release Log

version release date description
v1.1.0 02/03/2023 add autoload directory support
v1.2.2 06/27/2023 make all directory store in file

About

A simple script to switch directory quickly for powershell, bash and zsh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published