Skip to content

Commit

Permalink
fix: switch to grit installer
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Oct 26, 2024
1 parent e3888a5 commit b85ee82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
```
cargo build
cargo install --path .
marzano --help
grit --help
```

## Usage

1. check to run a pattern on a file

```
marzano check --pattern=test_jsx.grit test_jsx.js
grit check --pattern=test_jsx.grit test_jsx.js
```

## Tests
Expand Down
6 changes: 3 additions & 3 deletions python/gritql/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def find_install() -> Path:
install_dir = dir_name / ".install"
target_dir = install_dir / "bin"

target_path = target_dir / "marzano"
temp_file = target_dir / "marzano.tmp"
target_path = target_dir / "grit"
temp_file = target_dir / "grit.tmp"

if target_path.exists():
_debug(f"{target_path} already exists")
Expand All @@ -67,7 +67,7 @@ def find_install() -> Path:
arch = _get_arch()
_debug(f"Using architecture {arch}")

file_name = f"marzano-{arch}-{platform}"
file_name = f"grit-{arch}-{platform}"
download_url = f"https://github.com/getgrit/gritql/releases/latest/download/{file_name}.tar.gz"

sys.stdout.write(f"Downloading Grit CLI from {download_url}\n")
Expand Down
8 changes: 4 additions & 4 deletions python/gritql/tests/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_find_install_download_grit_macos():

result = find_install()
assert isinstance(result, Path)
assert result.name == 'marzano'
assert result.name == 'grit'

# Test the URL that is called
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/marzano-aarch64-apple-darwin.tar.gz"
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/grit-aarch64-apple-darwin.tar.gz"
mock_client.return_value.__enter__.return_value.get.assert_called_once_with(expected_url, follow_redirects=True)

def test_find_install_download_grit_linux():
Expand All @@ -43,10 +43,10 @@ def test_find_install_download_grit_linux():

result = find_install()
assert isinstance(result, Path)
assert result.name == 'marzano'
assert result.name == 'grit'

# Test the URL that is called
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/marzano-x86_64-unknown-linux-gnu.tar.gz"
expected_url = "https://github.com/getgrit/gritql/releases/latest/download/grit-x86_64-unknown-linux-gnu.tar.gz"
mock_client.return_value.__enter__.return_value.get.assert_called_once_with(expected_url, follow_redirects=True)

def test_find_install_windows():
Expand Down

0 comments on commit b85ee82

Please sign in to comment.