Created
April 30, 2020 19:11
-
-
Save AshConnolly/4188ff4fe8373c390fb1afc1d51d5836 to your computer and use it in GitHub Desktop.
For loop to open all subdirectories of current directory in vscode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For loop to open all subdirectories in vscode | |
function openfoldersincode() { | |
declare -a dirs | |
i=1 | |
for d in */ | |
do | |
dirs[i++]="${d%/}" | |
done | |
echo "There are ${#dirs[@]} dirs in the current path." | |
for((i=1;i<=${#dirs[@]};i++)) | |
do | |
echo $i "${dirs[i]}" | |
code "${dirs[i]}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment