Skip to content

Commit

Permalink
Change the delete of script to nullify the property.
Browse files Browse the repository at this point in the history
  • Loading branch information
depfeife-msft committed Mar 30, 2021
1 parent ece2a81 commit e97fa49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tools/paconn-cli/paconn/operations/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ def download(powerapps_rp, settings, destination, overwrite):
if _PROPERTIES not in api_registration:
raise CLIError('Properties not present in the api registration information.')

api_properties = api_registration[_PROPERTIES]

# Save the settings
write_settings(settings, overwrite)
api_properties = api_registration[_PROPERTIES]

# Property whitelist
property_keys_whitelist = [
Expand Down Expand Up @@ -171,5 +168,10 @@ def download(powerapps_rp, settings, destination, overwrite):
file=settings.script,
mode='wb'
).write(response.content)
else:
settings.script=None

# Save the settings
write_settings(settings, overwrite)

return directory
2 changes: 0 additions & 2 deletions tools/paconn-cli/paconn/settings/settingsserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def to_json_string(settings):
Serializes a settings object into string
"""
settings_dict = SettingsSerializer.serialize(settings)
if settings_dict.get(_SCRIPT) == '':
settings_dict.pop(_SCRIPT)
json_str = format_json(settings_dict)
return json_str

Expand Down
2 changes: 1 addition & 1 deletion tools/paconn-cli/paconn/settings/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def load_powerapps_and_flow_rp(settings, command_context):
settings.api_properties = settings.api_properties or 'apiProperties.json'
settings.api_definition = settings.api_definition or 'apiDefinition.swagger.json'
settings.icon = settings.icon or 'icon.png'
settings.script = settings.script or ''
settings.script = settings.script or 'script.csx'

# Prompt for environment for any
# operation other than `validate`
Expand Down

0 comments on commit e97fa49

Please sign in to comment.