mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-23 22:18:38 +00:00
Add optional.
This commit is contained in:
parent
0ce8c91240
commit
739ef41325
@ -3,6 +3,7 @@ import subprocess
|
|||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
import click
|
import click
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
# Requires click
|
# Requires click
|
||||||
# pip install click
|
# pip install click
|
||||||
@ -17,8 +18,12 @@ import click
|
|||||||
@click.option('--input-dmg', required=True, help='Path to the input DMG file.')
|
@click.option('--input-dmg', required=True, help='Path to the input DMG file.')
|
||||||
@click.option('--output-dmg', required=True, help='Path to the output signed DMG file.')
|
@click.option('--output-dmg', required=True, help='Path to the output signed DMG file.')
|
||||||
@click.option('--sha1-hash', help='SHA-1 hash of the Developer ID Installer certificate')
|
@click.option('--sha1-hash', help='SHA-1 hash of the Developer ID Installer certificate')
|
||||||
@click.option('--signing-identity', help='Signing identity (Developer ID Installer).')
|
@click.option('--signing-identity', default=None, help='Common name of the Developer ID Installer certificate')
|
||||||
def sign_dmg(input_dmg: str, output_dmg: str, signing_identity: str, sha1_hash: Optional[str]) -> None:
|
def sign_dmg(input_dmg: str, output_dmg: str, signing_identity: Optional[str] = None, sha1_hash: Optional[str] = None) -> None:
|
||||||
|
if not signing_identity and not sha1_hash:
|
||||||
|
print("Error: Either --signing-identity or --sha1-hash must be provided.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Mount the input DMG
|
# Mount the input DMG
|
||||||
mount_point = tempfile.mkdtemp()
|
mount_point = tempfile.mkdtemp()
|
||||||
subprocess.run(['hdiutil', 'attach', input_dmg, '-mountpoint', mount_point])
|
subprocess.run(['hdiutil', 'attach', input_dmg, '-mountpoint', mount_point])
|
||||||
|
Loading…
Reference in New Issue
Block a user