mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-10-02 19:57:59 +00:00
Stop rationing copilot page inspection and show the page after acting (#7808)
Co-authored-by: AronPerez <aperez0295@gmail.com>
This commit is contained in:
parent
9ae2e793ab
commit
6c5426a0ec
1 changed files with 36 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
"""Install a staged dataset directory without replacing an existing destination."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def install_directory(source: Path, destination: Path) -> None:
|
||||
"""Move ``source`` to ``destination`` when the destination is absent."""
|
||||
if destination.exists() or destination.is_symlink():
|
||||
raise FileExistsError(f"Destination already exists: {destination}")
|
||||
if not source.is_dir() or source.is_symlink():
|
||||
raise NotADirectoryError(f"Source is not a directory: {source}")
|
||||
|
||||
source.rename(destination)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Parse command-line arguments and install the staged directory."""
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("source", type=Path)
|
||||
parser.add_argument("destination", type=Path)
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
install_directory(args.source, args.destination)
|
||||
except OSError as exc:
|
||||
print(exc, file=sys.stderr)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue