Fixes #75
Added script that count lines in remote repository
OUTPUTCommand Usedbash gitlines <repo_url>
Command Usedbash gitlines
EXPLANATION OF CODEif [ "$#" -eq 0 ]; then
Checks if no argument is passed then asks user to enter the repository name as argument
repo_url=$1
Stores the URL passed into the a variable named repo_url
temporary_directory=$(mktemp -d)
Creates a temporary directory and stores it in the variable named temporary_directory
git clone "$repo_url" "$temporary_directory"
Clones the given repository into the local system inside the temporary directory we created
cd "$temporary_directory" || exit
Changes the present working directory into temporary directory
cloc $temporary_directory
This command allows user to count no. of lines in the directory and displays them into the terminal according to the programming language
rm -rf "$temporary_directory"
Removes the directory to prevent the storage from getting full. rm -rf is used to forcefully remove the files and folders.
Fixes #75 Added script that count lines in remote repository
OUTPUT Command Used
bash gitlines <repo_url>
Command Used
bash gitlines
EXPLANATION OF CODE
if [ "$#" -eq 0 ]; then
Checks if no argument is passed then asks user to enter the repository name as argumentrepo_url=$1
Stores the URL passed into the a variable namedrepo_url
temporary_directory=$(mktemp -d)
Creates a temporary directory and stores it in the variable namedtemporary_directory
git clone "$repo_url" "$temporary_directory"
Clones the given repository into the local system inside the temporary directory we createdcd "$temporary_directory" || exit
Changes the present working directory into temporary directorycloc $temporary_directory
This command allows user to count no. of lines in the directory and displays them into the terminal according to the programming languagerm -rf "$temporary_directory"
Removes the directory to prevent the storage from getting full.rm -rf
is used to forcefully remove the files and folders.