-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement nimble shellenv and nimble shell
Added commands `nimble shell` and `nimble shellenv` to allow using shell in the scope of the project
- Loading branch information
Showing
7 changed files
with
117 additions
and
1 deletion.
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,28 @@ | ||
{ | ||
"version": 2, | ||
"packages": { | ||
"unittest2": { | ||
"version": "0.0.6", | ||
"vcsRevision": "883c7a50ad3b82158e64d074c5578fe33ab3c452", | ||
"url": "https://github.com/status-im/nim-unittest2", | ||
"downloadMethod": "git", | ||
"dependencies": [], | ||
"checksums": { | ||
"sha1": "540e3959bd489b423dcd7d5f6373fa43153c35c8" | ||
} | ||
}, | ||
"testutils": { | ||
"version": "0.5.0", | ||
"vcsRevision": "dfc4c1b39f9ded9baf6365014de2b4bfb4dafc34", | ||
"url": "https://github.com/status-im/nim-testutils", | ||
"downloadMethod": "git", | ||
"dependencies": [ | ||
"unittest2" | ||
], | ||
"checksums": { | ||
"sha1": "756d0757c4dd06a068f9d38c7f238576ba5ee897" | ||
} | ||
} | ||
}, | ||
"tasks": {} | ||
} |
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,11 @@ | ||
# Package | ||
|
||
version = "0.1.0" | ||
author = "Ivan Yonchovski" | ||
description = "A new awesome nimble package" | ||
license = "MIT" | ||
srcDir = "src" | ||
bin = @["demo"] | ||
|
||
# Dependencies | ||
requires "testutils == 0.5.0" |
Empty file.
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,30 @@ | ||
# Copyright (C) Dominik Picheta. All rights reserved. | ||
# BSD License. Look at license.txt for more info. | ||
|
||
{.used.} | ||
|
||
import unittest, os, osproc, strutils | ||
import testscommon | ||
from nimblepkg/common import cd | ||
|
||
const | ||
separator = when defined(windows): ";" else: ":" | ||
|
||
suite "Shell env": | ||
test "Shell env": | ||
cd "shellenv": | ||
let (output, exitCode) = execCmdEx(nimblePath & " shellenv") | ||
check exitCode == QuitSuccess | ||
let | ||
prefixValPair = split(output, "=") | ||
prefix = prefixValPair[0] | ||
value = prefixValPair[1] | ||
dirs = value.split(separator) | ||
|
||
when defined windows: | ||
check prefix == "set PATH" | ||
else: | ||
check prefix == "export PATH" | ||
|
||
check dirs[0].extractFileName == "shellenv" | ||
check dirs[1].extractFileName == "testutils-0.5.0-756d0757c4dd06a068f9d38c7f238576ba5ee897" |