Skip to content

Commit accb620

Browse files
authored
Merge pull request #71 from martindurant/bits
CLI missing bits
2 parents a04ab75 + 2b60ced commit accb620

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

src/projspec/__main__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ def list(json_out):
200200
@library.command("delete")
201201
@click.argument("url")
202202
def delete(url):
203+
"""Delete the project at the given URL from the library.
204+
205+
URL must be given as shows in `list`.
206+
"""
203207
from projspec.library import ProjectLibrary
204208

205209
library = ProjectLibrary()
@@ -230,6 +234,18 @@ def show():
230234
print(conf)
231235

232236

237+
@config.command("defaults")
238+
def defaults():
239+
"""Show default config settings for all available values and their definitions"""
240+
from projspec.config import defaults, config_doc
241+
import os
242+
243+
print("PROJSPEC_CONFIG_DIR", os.environ.get("PROJSPEC_CONFIG_DIR", "unset"))
244+
print()
245+
for k, v, d in zip(defaults(), defaults().values(), config_doc.values()):
246+
print(f"{k}: {v} -- {d}")
247+
248+
233249
@config.command("unset")
234250
@click.argument("key")
235251
def unset(key):

src/projspec/artifact/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _check_runner(self):
3535

3636
@property
3737
def state(self) -> Literal["clean", "done", "pending", ""]:
38-
if get_conf("remote_artifact_status"):
38+
if get_conf("remote_artifact_status") or self.proj.is_local():
3939
if self._is_clean():
4040
return "clean"
4141
elif self._is_done():
@@ -47,7 +47,7 @@ def state(self) -> Literal["clean", "done", "pending", ""]:
4747

4848
def make(self, *args, **kwargs):
4949
"""Create the artifact and any runtime it depends on"""
50-
if not isinstance(self.proj.fs, fsspec.implementations.local.LocalFileSystem):
50+
if not self.proj.is_local():
5151
# Later, will implement download-and-make, although some tools
5252
# can already do this themselves.
5353
raise RuntimeError("Can't run local command on remote project")

src/projspec/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def defaults():
3030
"scan_max_size": "don't scan files bigger than this (in bytes)",
3131
"remote_artifact_status": "whether to check status for remote artifacts",
3232
"capture_artifact_output": (
33-
"if True, capture and enqueue output from spawned Process artifacts."
33+
"if True, capture and enqueue output from spawned Process artifacts. "
3434
"Otherwise, output appears on stdout/err."
3535
),
3636
}

vsextension/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ function getTreeWebviewContent(treeData: TreeNode, specNames: string[] = [], scr
12671267
command: 'selectProject',
12681268
item: itemData
12691269
});
1270-
} else if (itemData.projectUrl && !itemData.children) {
1270+
} else if (itemData.projectUrl && (!itemData.children || itemData.itemType === 'spec')) {
12711271
vscode.postMessage({
12721272
command: 'selectItem',
12731273
item: itemData

0 commit comments

Comments
 (0)