Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository 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
Glasgow Haskell Compiler
Packages
Cabal
Commits
99d29e43
Commit
99d29e43
authored
12 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Patches
Plain Diff
Make 'sandbox delete' read the saved sandbox location.
It doesn't make much sense to use the --sandbox flag.
parent
75b9537f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Distribution/Client/Sandbox.hs
+22
-24
22 additions, 24 deletions
cabal-install/Distribution/Client/Sandbox.hs
with
22 additions
and
24 deletions
cabal-install/Distribution/Client/Sandbox.hs
+
22
−
24
View file @
99d29e43
...
...
@@ -188,30 +188,28 @@ sandboxInit verbosity sandboxFlags globalFlags = do
-- | Entry point for the 'cabal sandbox-delete' command.
sandboxDelete
::
Verbosity
->
SandboxFlags
->
GlobalFlags
->
IO
()
sandboxDelete
verbosity
sandboxFlags
_globalFlags
=
do
pkgEnvDir
<-
getCurrentDirectory
-- Remove the cabal.sandbox.config file
removeFile
(
pkgEnvDir
</>
sandboxPackageEnvironmentFile
)
-- Remove the sandbox directory, unless it doesn't exist or we're using a
-- shared sandbox.
sandboxLocDoesNotExist
<-
fmap
not
.
doesDirectoryExist
$
sandboxLoc
let
isNonDefaultLocation
=
sandboxLoc
/=
(
pkgEnvDir
</>
defaultSandboxLocation
)
when
sandboxLocDoesNotExist
$
die
$
"No sandbox exists at this location: "
++
sandboxLoc
when
isNonDefaultLocation
$
die
$
"Non-default sandbox location used: "
++
sandboxLoc
++
"
\n
Assuming a shared sandbox. Please delete manually."
sandboxDir
<-
tryCanonicalizePath
sandboxLoc
notice
verbosity
$
"Deleting the sandbox located at "
++
sandboxDir
removeDirectoryRecursive
sandboxDir
where
sandboxLoc
=
fromFlagOrDefault
defaultSandboxLocation
(
sandboxLocation
sandboxFlags
)
sandboxDelete
verbosity
_sandboxFlags
globalFlags
=
do
(
useSandbox
,
_
)
<-
loadConfigOrSandboxConfig
verbosity
(
globalConfigFile
globalFlags
)
mempty
case
useSandbox
of
NoSandbox
->
die
"Not in a sandbox."
UseSandbox
sandboxDir
->
do
pkgEnvDir
<-
getCurrentDirectory
-- Remove the cabal.sandbox.config file
removeFile
(
pkgEnvDir
</>
sandboxPackageEnvironmentFile
)
-- Remove the sandbox directory, unless we're using a shared sandbox.
let
isNonDefaultLocation
=
sandboxDir
/=
(
pkgEnvDir
</>
defaultSandboxLocation
)
when
isNonDefaultLocation
$
die
$
"Non-default sandbox location used: '"
++
sandboxDir
++
"'
\n
Assuming a shared sandbox. Please delete '"
++
sandboxDir
++
"' manually."
notice
verbosity
$
"Deleting the sandbox located at "
++
sandboxDir
removeDirectoryRecursive
sandboxDir
-- | Entry point for the 'cabal sandbox add-source' command.
sandboxAddSource
::
Verbosity
->
[
FilePath
]
->
SandboxFlags
->
GlobalFlags
...
...
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