This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add undo yvm effects on the shell commands (#400)
* wip: placeholders for unuse and unload * wip: get old and shim path internal commands * wip: update tests * test: new util path functions * wip: fix get old and shim path commands * wip: only echo shimming when manually called * wip: remove yvm fish functions on unload * wip: only echo deactivate when manually called * wip: add bash commands to undo yvm * docs: update api docs * wip: unset regular PATH when in fish shell
- Loading branch information
Emmanuel Ogbizi
authored
Jun 12, 2019
1 parent
b67b638
commit 32a2ebc
Showing
12 changed files
with
340 additions
and
82 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import log from 'util/log' | ||
import { getNonYvmPathEntries, toPathString } from 'util/path' | ||
|
||
export const buildOldPath = shell => | ||
toPathString({ shell, paths: [...new Set(getNonYvmPathEntries(shell))] }) | ||
|
||
export const getOldPath = async shell => { | ||
try { | ||
log.capturable(buildOldPath(shell)) | ||
return 0 | ||
} catch (e) { | ||
log.error(e.message) | ||
log.info(e.stack) | ||
return 1 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import log from 'util/log' | ||
import { shimRootPath } from 'util/utils' | ||
import { getNonYvmShimPathEntries, toPathString, yvmPath } from 'util/path' | ||
|
||
export const buildShimPath = shell => { | ||
const updatedPath = [ | ||
shimRootPath(yvmPath), | ||
...new Set(getNonYvmShimPathEntries(shell)), | ||
] | ||
return toPathString({ shell, paths: updatedPath }) | ||
} | ||
|
||
export const getShimPath = async shell => { | ||
try { | ||
log.capturable(buildShimPath(shell)) | ||
return 0 | ||
} catch (e) { | ||
log.error(e.message) | ||
log.info(e.stack) | ||
return 1 | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.