perf(init): use $RANDOM env-var instead of starship session to generate session-key (#1755)

This commit is contained in:
Gautham Warrier 2020-11-07 21:00:08 +05:30 committed by GitHub
parent 30db07aaf3
commit 7450510327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -86,4 +86,6 @@ STARSHIP_START_TIME=$(::STARSHIP:: time)
export STARSHIP_SHELL="bash"
# Set up the session key that will be used to store logs
export STARSHIP_SESSION_KEY=$(::STARSHIP:: session)
STARSHIP_SESSION_KEY="$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM"; # Random generates a number b/w 0 - 32767
STARSHIP_SESSION_KEY="${STARSHIP_SESSION_KEY}0000000000000000" # Pad it to 16+ chars.
export STARSHIP_SESSION_KEY=${STARSHIP_SESSION_KEY:0:16}; # Trim to 16-digits if excess.

View File

@ -78,4 +78,6 @@ STARSHIP_START_TIME=$(::STARSHIP:: time)
export STARSHIP_SHELL="zsh"
# Set up the session key that will be used to store logs
export STARSHIP_SESSION_KEY=$(::STARSHIP:: session)
STARSHIP_SESSION_KEY="$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM"; # Random generates a number b/w 0 - 32767
STARSHIP_SESSION_KEY="${STARSHIP_SESSION_KEY}0000000000000000" # Pad it to 16+ chars.
export STARSHIP_SESSION_KEY=${STARSHIP_SESSION_KEY:0:16}; # Trim to 16-digits if excess.