You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello 👋
I adapt the script from remove_imported_prefix.py for the french version.
You can find bellow the code.
# French version for 1Password renaming.importsubprocessimportjsonimportsys# Check CLI versiondefcheckCLIVersion():
r=subprocess.run(["op", "--version", "--format=json"], capture_output=True)
major, minor=r.stdout.decode("utf-8").rstrip().split(".", 2)[:2]
ifnotmajor==2andnotint(minor) >=25:
sys.exit(
"❌ You must be using version 2.25 or greater of the 1Password CLI. Please visit https://developer.1password.com/docs/cli/get-started to download the lastest version."
)
defgetVaults():
try:
returnsubprocess.run(
["op", "vault", "list", "--permission=manage_vault", "--format=json"],
check=True,
capture_output=True,
).stdoutexceptExceptionaserr:
print(
f"Encountered an error getting the list of vaults you have access to: ", err
)
returndefmain():
checkCLIVersion()
vaultList=json.loads(getVaults())
print(
"Removing 'Importé' suffix from all imported vaults in your 1Password account.\n\n"
)
forvaultinvaultList:
vaultID=vault["id"]
vaultName=vault["name"]
ifvaultName.endswith(" importé"):
trimmedName=vaultName.removesuffix(" importé")
try:
subprocess.run(
["op", "vault", "edit", vaultID, f"--name={trimmedName}"],
check=True,
capture_output=True,
)
print(f'\t Changed "{vaultName}" => "{trimmedName}"')
exceptExceptionaserr:
print(f"Encountered an error renaming {vaultName}: ", err)
continuemain()
Best
The text was updated successfully, but these errors were encountered:
Hello 👋
I adapt the script from remove_imported_prefix.py for the french version.
You can find bellow the code.
Best
The text was updated successfully, but these errors were encountered: