Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit 1819887

Browse files
committed
Merge branch 'oct17-patch' and release 2.6.1
2 parents bee8a76 + 8565e52 commit 1819887

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

pip_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0
1+
2.6.1

proscli/conductor.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,18 @@ def download(cfg, name, version, depot, no_check):
305305
identifier.version,
306306
descriptor.depot.config.name,
307307
descriptor.depot.registrar))
308-
descriptor.depot.download(identifier)
309-
if identifier.name == 'kernel':
310-
click.echo('''To create a new PROS project with this kernel, run `pros conduct new <folder> {0} {1}`,
311-
or to upgrade an existing project, run `pros conduct upgrade <folder> {0} {1}'''
312-
.format(identifier.version, identifier.depot))
313-
# todo: add helpful text for how to create a project or add the new library to a project
314-
315-
316-
317-
308+
new_identifier = descriptor.depot.download(identifier)
309+
if new_identifier == False:
310+
click.echo('Failed to download {0} {1} from {2}'.format(identifier.version, identifier.version, identifier.depot))
311+
else:
312+
if new_identifier.name == 'kernel':
313+
click.echo('''To create a new PROS project with this template, run `pros conduct new <folder> {0} {1}`,
314+
or to upgrade an existing project, run `pros conduct upgrade <folder> {0} {1}'''
315+
.format(new_identifier.version, new_identifier.depot))
316+
else:
317+
click.echo('''To add this library to a PROS project, run `pros conduct add-lib <folder> {0} {1} {2},
318+
or to upgrade an existing project with this library to the new version, run `pros conduct upgrade-lib <Folder> {0} {1} {2}'''
319+
.format(new_identifier.name, new_identifier.version, new_identifier.depot))
318320

319321
# endregion
320322

@@ -588,4 +590,5 @@ def first_run_cmd(cfg, no_force, use_defaults, no_download, apply_providers):
588590
first_run(cfg, force=no_force, defaults=use_defaults,
589591
doDownload=no_download, reapplyProviders=apply_providers)
590592

593+
591594
import proscli.conductor_management

proscli/upgrade.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ def upgrade_cli():
1414

1515
def get_upgrade_command():
1616
if getattr(sys, 'frozen', False):
17-
cmd = os.path.abspath(os.path.join(sys.executable, '..', '..', 'updater.exe'))
18-
if os.path.exists(cmd):
19-
return [cmd, '-reducedgui']
17+
if sys.platform == 'win32':
18+
cmd = os.path.abspath(os.path.join(sys.executable, '..', '..', 'updater.exe'))
19+
if os.path.exists(cmd):
20+
return [cmd, '/reducedgui', '/checknow']
21+
else:
22+
return False
2023
else:
2124
return False
2225
else:

prosconductor/providers/githubreleases.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os.path
77
import proscli.utils
88
from prosconductor.providers import TemplateTypes, DepotProvider, InvalidIdentifierException, DepotConfig, Identifier, \
9-
get_template_dir
9+
get_template_dir, TemplateConfig
1010
import re
1111
import requests
1212
import requests.exceptions
@@ -141,8 +141,14 @@ def download(self, identifier):
141141
zf.extract(file, path=template_dir)
142142
progress_bar.update(1)
143143
os.remove(tf.name)
144+
template_config = TemplateConfig(os.path.join(template_dir, 'template.pros'))
145+
if template_config.identifier.version != identifier.version:
146+
click.echo('WARNING: Version fetched does not have the same version downloaded {0} != {1}.'
147+
.format(template_config.identifier.version, identifier.version))
148+
os.rename(template_dir, get_template_dir(self, template_config.identifier))
149+
template_dir = get_template_dir(self, template_config.identifier)
144150
click.echo('Template downloaded to {}'.format(template_dir))
145-
return True
151+
return template_config.identifier
146152
else:
147153
click.echo('Unable to download {} from {} (Status code: {})'.format(asset['name'],
148154
self.config.location,

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0
1+
2.6.1

win_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0.0
1+
2.6.1.0

0 commit comments

Comments
 (0)