Commit 47d0eb3f authored by rgaudin's avatar rgaudin
Browse files

Added --filename option to specify output filename via CLI

parent 2406e018
......@@ -2,6 +2,7 @@
* Fixed bug prevent non-sdcard builds via GUI
* Better SD-card partition check dialog
* Added partition number check to CLI
* Added --filename option to specify output filename via CLI
2.0-rc16
* Fixed etcher-cli call on macOS GUI (space escaping)
......
......@@ -197,6 +197,7 @@ parser.add_argument(
"--config",
help="use a JSON config file to set parameters (superseeds cli parameters)",
)
parser.add_argument("--filename", help="Output file name (without suffix)")
parser.add_argument("--ram", help="Max RAM for QEMU", default="2G")
parser.add_argument("--sdcard", help="Device to copy image to")
......@@ -370,6 +371,7 @@ try:
css=args.css,
admin_account=admin_account,
build_dir=args.build_dir,
filename=args.filename,
qemu_ram=args.ram,
)
except Exception:
......
......@@ -62,6 +62,7 @@ def run_installation(
css,
done_callback=None,
build_dir=".",
filename=None,
qemu_ram="2G",
):
......@@ -98,13 +99,14 @@ def run_installation(
logger.step("Prepare Image file")
# set image names
today = datetime.today().strftime("%Y_%m_%d-%H_%M_%S")
if not filename:
filename = "hotspot-{}".format(
datetime.today().strftime("%Y_%m_%d-%H_%M_%S")
)
image_final_path = os.path.join(build_dir, "hotspot-{}.img".format(today))
image_building_path = os.path.join(
build_dir, "hotspot-{}.BUILDING.img".format(today)
)
image_error_path = os.path.join(build_dir, "hotspot-{}.ERROR.img".format(today))
image_final_path = os.path.join(build_dir, filename + ".img")
image_building_path = os.path.join(build_dir, filename + ".BUILDING.img")
image_error_path = os.path.join(build_dir, filename + ".ERROR.img")
# loop device mode on linux (for mkfs in userspace)
if sys.platform == "linux":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment