Commit 23d38cb5 authored by Thomas de Grenier de Latour's avatar Thomas de Grenier de Latour
Browse files

feat: handle $DRY_RUN and $HALT_ON_ERROR env vars

parent f4a57e8e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -88,8 +88,8 @@ options:
| `--new-group-options-from`   | `$NEW_GROUP_OPTIONS_FROM`       | a JSON file with extra options for groups creation; incompatible with --new-group-options                             |
| `--new-project-options`      | `$NEW_PROJECT_OPTIONS`          | a JSON string with extra options for projects creation (default value disables issues and MR, *see below*)            |
| `--new-project-options-from` | `$NEW_PROJECT_OPTIONS_FROM`     | a JSON file with extra options for projects creation; incompatible with --new-project-options                         |
| `--dry-run`                  | _none_                          | dry run (don't execute any write action)                                                                              |
| `--halt-on-error`            | _none_                          | halt synchronizing when an error occurs                                                                               |
| `--dry-run`                  | `$DRY_RUN`                      | dry run (don't execute any write action)                                                                              |
| `--halt-on-error`            | `$HALT_ON_ERROR`                | halt synchronizing when an error occurs                                                                               |
| `--cache-dir`                | `$CACHE_DIR`                    | cache directory (used to download resources such as images and Git repositories) (defaults to `.work`)                |

Default options for creating new projects:
+2 −0
Original line number Diff line number Diff line
@@ -881,11 +881,13 @@ def run() -> None:
    )
    parser.add_argument(
        "--dry-run",
        default=os.getenv("DRY_RUN") is not None,
        action="store_true",
        help="dry run (don't execute any write action)",
    )
    parser.add_argument(
        "--halt-on-error",
        default=os.getenv("HALT_ON_ERROR") is not None,
        action="store_true",
        help="halt synchronizing whenever an error occurs",
    )