plain.code 0.7.1__tar.gz → 0.8.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.code
3
- Version: 0.7.1
3
+ Version: 0.8.1
4
4
  Summary: Code formatting and linting for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -105,6 +105,12 @@ class Biome:
105
105
  )
106
106
  resp = requests.get(url, stream=True)
107
107
  resp.raise_for_status()
108
+
109
+ # Make sure the target directory exists
110
+ td = self.target_directory
111
+ if not os.path.isdir(td):
112
+ os.makedirs(td, exist_ok=True)
113
+
108
114
  with open(self.standalone_path, "wb") as f:
109
115
  for chunk in resp.iter_content(chunk_size=8192):
110
116
  f.write(chunk)
@@ -5,7 +5,7 @@
5
5
  "useIgnoreFile": true
6
6
  },
7
7
  "files": {
8
- "ignore": ["**/vendor/**", "**/*.min.*", "**/tests/**"]
8
+ "ignore": ["**/vendor/**", "**/*.min.*", "**/tests/**", "**/htmlcov/**"]
9
9
  },
10
10
  "formatter": {
11
11
  "indentStyle": "space"
@@ -21,18 +21,26 @@ def cli():
21
21
 
22
22
 
23
23
  @cli.command()
24
+ @click.option("--force", is_flag=True, help="Reinstall even if up to date")
24
25
  @click.pass_context
25
- def install(ctx):
26
+ def install(ctx, force):
26
27
  """Install or update the Biome standalone per configuration."""
27
- if version := get_code_config().get("biome", {}).get("version", ""):
28
- biome = Biome()
29
- click.secho(
30
- f"Installing Biome standalone version {version}...", bold=True, nl=False
31
- )
32
- installed = biome.install(version)
33
- click.secho(f"Biome {installed} installed", fg="green")
28
+ biome = Biome()
29
+
30
+ if force or not biome.is_installed() or biome.needs_update():
31
+ version_to_install = get_code_config().get("biome", {}).get("version", "")
32
+ if version_to_install:
33
+ click.secho(
34
+ f"Installing Biome standalone version {version_to_install}...",
35
+ bold=True,
36
+ nl=False,
37
+ )
38
+ installed = biome.install(version_to_install)
39
+ click.secho(f"Biome {installed} installed", fg="green")
40
+ else:
41
+ ctx.invoke(update)
34
42
  else:
35
- ctx.invoke(update)
43
+ click.secho("Biome already installed", fg="green")
36
44
 
37
45
 
38
46
  @cli.command()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.code"
3
- version = "0.7.1"
3
+ version = "0.8.1"
4
4
  description = "Code formatting and linting for Plain."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes