Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gershomb
ghcup
Commits
032b95aa
Unverified
Commit
032b95aa
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Remove show command, which is obsolete now
parent
f26830c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.sh
+0
-2
0 additions, 2 deletions
.travis.sh
ghcup
+31
-98
31 additions, 98 deletions
ghcup
with
31 additions
and
100 deletions
.travis.sh
+
0
−
2
View file @
032b95aa
...
...
@@ -59,8 +59,6 @@ edo mv shellcheck-latest/shellcheck "$HOME"/.local/bin/shellcheck
# check our script for errors
edo shellcheck ghcup
edo ghcup
-v
show
edo ghcup
-v
debug-info
edo ghcup
-v
list
...
...
This diff is collapsed.
Click to expand it.
ghcup
+
31
−
98
View file @
032b95aa
...
...
@@ -185,7 +185,6 @@ FLAGS:
SUBCOMMANDS:
install Install GHC
$(
${
VERBOSE
}
&&
printf
"
\n
compile Compile and install GHC from source (UNSTABLE!!!)"
)
show Show current/installed GHC
set Set currently active GHC version
list Show available GHCs and other tools
upgrade Upgrade this script in-place
...
...
@@ -277,24 +276,6 @@ ARGS:
exit
1
}
# @FUNCTION: show_usage
# @DESCRIPTION:
# Print the help message for 'ghcup show' to STDERR
# and exit the script with status code 1.
show_usage
()
{
(>
&2
echo
"ghcup-show
Show the installed/current GHC versions
USAGE:
${
SCRIPT
}
show [FLAGS]
FLAGS:
-h, --help Prints help information
-i, --installed Show installed GHC version only
"
)
exit
1
}
# @FUNCTION: rm_usage
# @DESCRIPTION:
# Print the help message for 'ghcup rm' to STDERR
...
...
@@ -1249,6 +1230,37 @@ array_contains() {
return
1
}
# @FUNCTION: show_ghc_installed
# @DESCRIPTION:
# Prints the currently selected GHC only as version string.
# @STDOUT: current GHC version
show_ghc_installed
()
{
current_ghc
=
"
${
BIN_LOCATION
}
/ghc"
real_ghc
=
$(
posix_realpath
"
${
current_ghc
}
"
)
if
[
-L
"
${
current_ghc
}
"
]
;
then
# is symlink
if
[
-e
"
${
real_ghc
}
"
]
;
then
# exists (posix_realpath was called)
real_ghc
=
"
$(
basename
"
${
real_ghc
}
"
|
sed
's#ghc-##'
)
"
printf
"%s"
"
${
real_ghc
}
"
else
# is a broken symlink
red_message
"broken symlink"
fi
fi
unset
real_ghc current_ghc
}
# @FUNCTION: show_cabal_installed
# @DESCRIPTION:
# Prints the currently selected cabal only as version string.
# @STDOUT: current cabal version
show_cabal_installed
()
{
if
[
-x
"
${
BIN_LOCATION
}
/cabal"
]
;
then
"
${
BIN_LOCATION
}
/cabal"
--numeric-version
fi
}
############################
...
...
@@ -1415,68 +1427,6 @@ upgrade() {
#########################
#--[ Subcommand show ]--#
#########################
# @FUNCTION: show_ghc
# @DESCRIPTION:
# Prints the currently installed and selected GHC, in human-friendly
# format.
show_ghc
()
{
current_ghc
=
$(
show_ghc_installed
)
echo
"Installed GHCs:"
for
i
in
"
${
GHC_LOCATION
}
"
/
*
;
do
if
[
-e
"
${
i
}
"
]
;
then
echo
"
$(
basename
"
${
i
}
"
)
"
else
# directory is empty
echo
" None"
exit
0
fi
done
if
[
-n
"
${
current_ghc
}
"
]
;
then
echo
echo
"Current GHC"
echo
"
${
current_ghc
}
"
fi
unset
current_ghc i
}
# @FUNCTION: show_ghc_installed
# @DESCRIPTION:
# Prints the currently selected GHC only as version string.
# @STDOUT: current GHC version
show_ghc_installed
()
{
current_ghc
=
"
${
BIN_LOCATION
}
/ghc"
real_ghc
=
$(
posix_realpath
"
${
current_ghc
}
"
)
if
[
-L
"
${
current_ghc
}
"
]
;
then
# is symlink
if
[
-e
"
${
real_ghc
}
"
]
;
then
# exists (posix_realpath was called)
real_ghc
=
"
$(
basename
"
${
real_ghc
}
"
|
sed
's#ghc-##'
)
"
printf
"%s"
"
${
real_ghc
}
"
else
# is a broken symlink
red_message
"broken symlink"
fi
fi
unset
real_ghc current_ghc
}
# @FUNCTION: show_cabal_installed
# @DESCRIPTION:
# Prints the currently selected cabal only as version string.
# @STDOUT: current cabal version
show_cabal_installed
()
{
if
[
-x
"
${
BIN_LOCATION
}
/cabal"
]
;
then
"
${
BIN_LOCATION
}
/cabal"
--numeric-version
fi
}
#######################
#--[ Subcommand rm ]--#
...
...
@@ -2004,23 +1954,6 @@ while [ $# -gt 0 ] ; do
upgrade
"
$(
dirname
"
$(
posix_realpath
"
${
SOURCE
}
"
)
"
)
"
fi
break
;;
show
)
SHOW_INSTALLED
=
false
shift
1
while
[
$#
-gt
0
]
;
do
case
$1
in
-h
|
--help
)
show_usage
;;
-i
|
--installed
)
SHOW_INSTALLED
=
true
break
;;
*
)
show_usage
;;
esac
done
if
${
SHOW_INSTALLED
}
;
then
show_ghc_installed
else
show_ghc
fi
break
;;
rm
)
shift
1
while
[
$#
-gt
0
]
;
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment