Skip to content

Commit

Permalink
disable ea
Browse files Browse the repository at this point in the history
  • Loading branch information
12944qwerty committed Nov 27, 2023
1 parent 76ac7fb commit db9ab99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def fetch(query: c.BaseTemplate):
help="Force apply the template, disregarding if the template is already installed.")
@click.option('--remove-empty-dirs/--no-remove-empty-dirs', 'remove_empty_directories', is_flag=True, default=True,
help='Remove empty directories when removing files')
@click.option('--early-access', '--early', '-ea', 'early_access', '--beta', is_flag=True, default=False, show_default=True,
@click.option('--early-access/--no-early-access', '--early/--no-early', '-ea/-nea', 'early_access', '--beta/--no-beta', default=None,
help='Create a project using the PROS 4 kernel')
@project_option()
@template_query(required=True)
Expand Down Expand Up @@ -142,7 +142,7 @@ def install(ctx: click.Context, **kwargs):
help="Force apply the template, disregarding if the template is already installed.")
@click.option('--remove-empty-dirs/--no-remove-empty-dirs', 'remove_empty_directories', is_flag=True, default=True,
help='Remove empty directories when removing files')
@click.option('--early-access', '--early', '-ea', 'early_access', '--beta', is_flag=True, default=False, show_default=True,
@click.option('--early-access/--no-early-access', '--early/--no-early', '-ea/-nea', 'early_access', '--beta/--no-beta', default=None,
help='Create a project using the PROS 4 kernel')
@project_option()
@template_query(required=False)
Expand Down Expand Up @@ -204,7 +204,7 @@ def uninstall_template(project: c.Project, query: c.BaseTemplate, remove_user: b
help='Compile the project after creation')
@click.option('--build-cache', is_flag=True, default=None, show_default=False,
help='Build compile commands cache after creation. Overrides --compile-after if both are specified.')
@click.option('--early-access', '--early', '-ea', 'early_access', '--beta', is_flag=True, default=False, show_default=True,
@click.option('--early-access/--no-early-access', '--early/--no-early', '-ea/-nea', 'early_access', '--beta/--no-beta', default=None,
help='Create a project using the PROS 4 kernel')
@click.pass_context
@default_options
Expand Down Expand Up @@ -255,7 +255,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
help='Force update all remote depots, ignoring automatic update checks')
@click.option('--limit', type=int, default=15,
help='The maximum number of displayed results for each library')
@click.option('--early-access', '--early', '-ea', '--beta', 'early_access', is_flag=True, default=False, show_default=True,
@click.option('--early-access/--no-early-access', '--early/--no-early', '-ea/-nea', 'early_access', '--beta/--no-beta', default=None,
help='View a list of early access templates')
@template_query(required=False)
@click.pass_context
Expand Down
5 changes: 3 additions & 2 deletions pros/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def resolve_templates(self, identifier: Union[str, BaseTemplate], allow_online:
unique: bool = True, **kwargs) -> List[BaseTemplate]:
results = list() if not unique else set()
kernel_version = kwargs.get('kernel_version', None)
self.use_early_access = kwargs.get('early_access', False) or self.use_early_access
self.use_early_access = [kwargs.get('early_access', False), self.use_early_access][kwargs.get('early_access', None) is None]
if isinstance(identifier, str):
query = BaseTemplate.create_query(name=identifier, **kwargs)
else:
Expand Down Expand Up @@ -255,6 +255,7 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate],
self.warn_early_access = True
self.save()
if not confirm:
project.delete()
raise dont_send(
InvalidTemplateException(f'Not using PROS 3'))
if not isinstance(template, LocalTemplate):
Expand Down Expand Up @@ -296,7 +297,7 @@ def remove_template(project: Project, identifier: Union[str, BaseTemplate], remo
remove_empty_directories=remove_empty_directories)

def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Project:
self.use_early_access = kwargs.get('early_access', False) or self.use_early_access
self.use_early_access = [kwargs.get('early_access', False), self.use_early_access][kwargs.get('early_access', None) is None]
if kwargs["version_source"]: # If true, then the user has not specified a version
if not self.use_early_access and self.warn_early_access:
ui.echo(f"PROS 4 is now in early access. "
Expand Down

0 comments on commit db9ab99

Please sign in to comment.