File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ stop Wed 07 Oct 2020 05:00:00 AM UTC
21
21
3 . For persistence, add it to your .bashrc or similar:
22
22
* ` source "$HOME/.cmdw" `
23
23
24
+ Install one-liner: ` source <(curl -s https://raw.githubusercontent.com/0xZDH/cmdw/master/install.sh) `
25
+
24
26
## History Size:
25
27
If required, the user can modify the size of the maintained history file by setting CMDWSIZE as an environment variable (Default: 3,000):
26
28
* ` export CMDWSIZE=1000 `
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # ######################################
3
+ # Automate the install process for .cmdw
4
+ # wrapper.
5
+ #
6
+ # Install:
7
+ # source <(curl -s https://raw.githubusercontent.com/0xZDH/cmdw/master/install.sh)
8
+ # ######################################
9
+
10
+ # Validate the current terminal is Bash or Zsh.
11
+ [ -n " $BASH_VERSION " -o -n " $ZSH_VERSION " ] || return 0
12
+
13
+ # Download cmdw.sh to our home directory. Force the file
14
+ # to be overwritten when it exists to allow for updates
15
+ # to be installed.
16
+ curl -s -o " $HOME /.cmdw" \
17
+ -q " https://raw.githubusercontent.com/0xZDH/cmdw/master/cmdw.sh"
18
+
19
+ # Identify current shell type
20
+ [ -n " $ZSH_VERSION " ] && \
21
+ shell_file=" $HOME /.zshrc" || \
22
+ shell_file=" $HOME /.bashrc"
23
+
24
+ # Add .cmdw to our shell profile
25
+ [ ! " $( grep ' source $HOME/.cmdw' " $shell_file " ) " ] && \
26
+ echo ' [ -f $HOME/.cmdw ] && source $HOME/.cmdw' >> " $shell_file "
27
+
28
+ # Reload our shell profile
29
+ source " $shell_file "
30
+
31
+ # Clean up
32
+ unset shell_file
You can’t perform that action at this time.
0 commit comments