-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
argh
for dispatch instead of argparse
- Loading branch information
1 parent
08f8497
commit 983989d
Showing
14 changed files
with
271 additions
and
211 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,29 @@ | ||
""" Entry point for `tsrc apply-manifest` """ | ||
|
||
import argparse | ||
from typing import Optional | ||
from argh import arg | ||
from path import Path | ||
|
||
import cli_ui as ui | ||
import tsrc.cli | ||
|
||
import tsrc.manifest | ||
from tsrc.cli import ( | ||
with_workspace, | ||
get_workspace, | ||
repos_from_config, | ||
) | ||
|
||
def main(args: argparse.Namespace) -> None: | ||
workspace = tsrc.cli.get_workspace(args) | ||
manifest_path = args.manifest_path | ||
|
||
ui.info_1("Applying manifest from", args.manifest_path) | ||
@with_workspace # type: ignore | ||
@arg("manifest_path", help="path to the local manifest", type=Path) # type: ignore | ||
def apply_manifest(manifest_path: Path, workspace_path: Optional[Path] = None) -> None: | ||
""" apply a local manifest file """ | ||
workspace = get_workspace(workspace_path) | ||
|
||
ui.info_1("Applying manifest from", manifest_path) | ||
|
||
manifest = tsrc.manifest.load(manifest_path) | ||
workspace.repos = tsrc.cli.repos_from_config(manifest, workspace.config) | ||
workspace.repos = repos_from_config(manifest, workspace.config) | ||
workspace.clone_missing() | ||
workspace.set_remotes() | ||
workspace.perform_filesystem_operations() |
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.