@champpaba/gslide 0.1.2 → 0.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@champpaba/gslide",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI tool for automating Google Slides 'Help me visualize' feature via browser automation",
5
5
  "bin": {
6
6
  "gslide": "./bin/gslide.mjs"
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gslide"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "CLI tool for automating Google Slides 'Help me visualize' feature via browser automation"
5
5
  requires-python = ">=3.10"
6
6
  dependencies = [
@@ -1,3 +1,3 @@
1
1
  """gslide — CLI for automating Google Slides 'Help me visualize' feature."""
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
package/src/gslide/cli.py CHANGED
@@ -13,47 +13,35 @@ def cli() -> None:
13
13
 
14
14
  @cli.command()
15
15
  def update() -> None:
16
- """Check for updates and self-update via npm."""
16
+ """Update gslide to the latest version."""
17
17
  import subprocess
18
18
 
19
19
  from gslide import __version__
20
20
 
21
- click.echo(f"Current version: v{__version__}")
22
- click.echo("Checking for updates...")
23
-
24
- try:
25
- result = subprocess.run(
26
- ["npm", "view", "@champpaba/gslide", "version", "--registry", "https://registry.npmjs.org"],
27
- capture_output=True,
28
- text=True,
29
- timeout=15,
30
- )
31
- latest = result.stdout.strip()
32
- except (subprocess.TimeoutExpired, FileNotFoundError):
33
- click.echo("Could not check npm registry.", err=True)
34
- sys.exit(1)
35
-
36
- if not latest:
37
- click.echo("Could not determine latest version.", err=True)
38
- sys.exit(1)
39
-
40
- if latest == __version__:
41
- click.echo(f"Already up to date (v{__version__}).")
42
- return
43
-
44
- click.echo(f"Latest version: v{latest}")
21
+ click.echo(f"Current: v{__version__}")
45
22
  click.echo("Updating...")
46
23
 
47
24
  proc = subprocess.run(
48
- ["npm", "update", "-g", "@champpaba/gslide"],
25
+ ["npm", "install", "-g", "@champpaba/gslide@latest"],
49
26
  timeout=120,
50
27
  )
51
- if proc.returncode == 0:
52
- click.echo(f"Updated to v{latest}.")
53
- else:
28
+ if proc.returncode != 0:
54
29
  click.echo("Update failed.", err=True)
55
30
  sys.exit(1)
56
31
 
32
+ # Check new version
33
+ result = subprocess.run(
34
+ ["node", "-e", "console.log(require(require('path').join(require('child_process').execSync('npm prefix -g').toString().trim(),'lib/node_modules/@champpaba/gslide/package.json')).version)"],
35
+ capture_output=True,
36
+ text=True,
37
+ )
38
+ new_ver = result.stdout.strip() if result.returncode == 0 else "unknown"
39
+
40
+ if new_ver == __version__:
41
+ click.echo(f"Already up to date (v{__version__}).")
42
+ else:
43
+ click.echo(f"Updated: v{__version__} -> v{new_ver}")
44
+
57
45
 
58
46
  # --- Auth commands ---
59
47