viur-cli 2.3.5__tar.gz → 2.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {viur_cli-2.3.5/src/viur_cli.egg-info → viur_cli-2.3.6}/PKG-INFO +1 -1
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/scriptor/cli.py +37 -8
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/version.py +1 -1
- {viur_cli-2.3.5 → viur_cli-2.3.6/src/viur_cli.egg-info}/PKG-INFO +1 -1
- {viur_cli-2.3.5 → viur_cli-2.3.6}/LICENSE +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/README.md +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/pyproject.toml +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/setup.cfg +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/__init__.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/build.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/cli.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/cloud.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/conf.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/deprecated.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/local.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/package.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/scriptor/__init__.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/scriptor/login.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/scripts/__init__.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/scripts/get_pyodide.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/setup.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/tool.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/update.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli/utils.py +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli.egg-info/SOURCES.txt +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli.egg-info/dependency_links.txt +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli.egg-info/entry_points.txt +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli.egg-info/requires.txt +0 -0
- {viur_cli-2.3.5 → viur_cli-2.3.6}/src/viur_cli.egg-info/top_level.txt +0 -0
|
@@ -144,23 +144,35 @@ def pull(ctx: click.Context, force: bool):
|
|
|
144
144
|
tree = await modules.get_module("script")
|
|
145
145
|
working_dir = scriptor_config.get("working_dir")
|
|
146
146
|
|
|
147
|
+
stats = {"new": 0, "updated": 0, "skipped": 0, "unchanged": 0, "dirs": 0}
|
|
148
|
+
|
|
147
149
|
async def process_entry(entry: dict, is_node: bool):
|
|
148
150
|
_path = os.path.join(working_dir, entry["path"].lstrip("/"))
|
|
149
151
|
|
|
150
152
|
if is_node:
|
|
151
153
|
if not os.path.exists(_path):
|
|
154
|
+
click.echo(click.style(f" mkdir {entry['path']}", fg="blue"))
|
|
152
155
|
os.makedirs(_path)
|
|
156
|
+
stats["dirs"] += 1
|
|
153
157
|
else:
|
|
158
|
+
click.echo(f" check {entry['path']}", nl=False)
|
|
159
|
+
|
|
154
160
|
def create_file():
|
|
155
161
|
with open(_path, "a+") as f:
|
|
156
162
|
f.write(entry["script"])
|
|
157
163
|
|
|
158
|
-
click.echo(f"Pull {_path}")
|
|
159
|
-
|
|
160
164
|
if os.path.exists(_path):
|
|
161
165
|
if force:
|
|
166
|
+
with open(_path, "r") as f:
|
|
167
|
+
changed = f.read().splitlines() != entry["script"].splitlines()
|
|
162
168
|
os.remove(_path)
|
|
163
169
|
create_file()
|
|
170
|
+
if changed:
|
|
171
|
+
click.echo(click.style(" [updated]", fg="yellow"))
|
|
172
|
+
stats["updated"] += 1
|
|
173
|
+
else:
|
|
174
|
+
click.echo(click.style(" [ok]", fg="green"))
|
|
175
|
+
stats["unchanged"] += 1
|
|
164
176
|
else:
|
|
165
177
|
with open(_path, "r") as f:
|
|
166
178
|
local_content = f.read()
|
|
@@ -173,23 +185,33 @@ def pull(ctx: click.Context, force: bool):
|
|
|
173
185
|
lineterm="",
|
|
174
186
|
))
|
|
175
187
|
if diff:
|
|
188
|
+
click.echo(click.style(" [diff]", fg="yellow"))
|
|
176
189
|
for line in diff:
|
|
177
190
|
if line.startswith("+++") or line.startswith("---"):
|
|
178
|
-
click.echo(click.style(line, bold=True)
|
|
191
|
+
click.echo(click.style(line, bold=True))
|
|
179
192
|
elif line.startswith("@@"):
|
|
180
|
-
click.echo(click.style(line, fg="cyan")
|
|
193
|
+
click.echo(click.style(line, fg="cyan"))
|
|
181
194
|
elif line.startswith("+"):
|
|
182
|
-
click.echo(click.style(line, fg="green")
|
|
195
|
+
click.echo(click.style(line, fg="green"))
|
|
183
196
|
elif line.startswith("-"):
|
|
184
|
-
click.echo(click.style(line, fg="red")
|
|
197
|
+
click.echo(click.style(line, fg="red"))
|
|
185
198
|
else:
|
|
186
|
-
click.echo(line
|
|
199
|
+
click.echo(line)
|
|
187
200
|
if click.confirm(f"Overwrite local {entry['path']} with remote version?"):
|
|
188
201
|
os.remove(_path)
|
|
189
202
|
create_file()
|
|
190
|
-
|
|
203
|
+
stats["updated"] += 1
|
|
204
|
+
else:
|
|
205
|
+
stats["skipped"] += 1
|
|
206
|
+
else:
|
|
207
|
+
click.echo(click.style(" [ok]", fg="green"))
|
|
208
|
+
stats["unchanged"] += 1
|
|
191
209
|
else:
|
|
210
|
+
click.echo(click.style(" [new]", fg="green"))
|
|
192
211
|
create_file()
|
|
212
|
+
stats["new"] += 1
|
|
213
|
+
|
|
214
|
+
click.echo("Fetching scripts from server...")
|
|
193
215
|
|
|
194
216
|
# Process nodes first
|
|
195
217
|
async for node in tree.list(skel_type="node"):
|
|
@@ -199,6 +221,13 @@ def pull(ctx: click.Context, force: bool):
|
|
|
199
221
|
async for leaf in tree.list(skel_type="leaf"):
|
|
200
222
|
await process_entry(leaf, False)
|
|
201
223
|
|
|
224
|
+
click.echo("")
|
|
225
|
+
click.echo(click.style("Summary:", bold=True))
|
|
226
|
+
click.echo(f" new: {stats['new']}")
|
|
227
|
+
click.echo(f" updated: {stats['updated']}")
|
|
228
|
+
click.echo(f" skipped: {stats['skipped']}")
|
|
229
|
+
click.echo(f" unchanged: {stats['unchanged']}")
|
|
230
|
+
|
|
202
231
|
asyncio.run(main())
|
|
203
232
|
|
|
204
233
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "2.3.
|
|
1
|
+
__version__ = "2.3.6"
|
|
2
2
|
MINIMAL_PIPENV = "2023.11.15"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|