-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-ls-sub
More file actions
executable file
·39 lines (33 loc) · 988 Bytes
/
git-ls-sub
File metadata and controls
executable file
·39 lines (33 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# _ _ _ _
# __ _(_) |_ | |___ ___ _ _| |__
# / _` | | __| | / __|_____/ __| | | | '_ \
# | (_| | | |_ | \__ \_____\__ \ |_| | |_) |
# \__, |_|\__| |_|___/ |___/\__,_|_.__/
# |___/
#
# Lists information about a directory or file from a repository hosted on
# GitHub.
#
# SOURCE: license_and_attribution
# Here's how you use the command:
USAGE_TEXT="usage: git ls-sub <github_url>
"
# SOURCE: usage
# TODO: check if downloaded is a folder or file
# SOURCE: translate_url
########################################################################
#
# main is the program itself. Here is the code that we run when we
# invoke the command!
#
########################################################################
main() {
# SOURCE: print_usage_by_default
# SOURCE: handle_options
git_url="${1}"
svn_url="$(translate_url "$git_url")"
svn ls --force-interactive "$svn_url"
}
# Run the main command.
main "$@"