-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Lenihan
committed
Feb 3, 2025
1 parent
9f526fa
commit 8cb42d8
Showing
5 changed files
with
56 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[tool.poetry] | ||
name = "aw-server-rust" | ||
version = "0.1.0" | ||
description = "Trayicon for ActivityWatch" | ||
authors = ["Erik Bjäreholt <[email protected]>"] | ||
license = "MPL-2.0" | ||
package-mode = false | ||
include = ["python/aw_server_rust.py"] # Explicitly include the script | ||
|
||
[tool.poetry.scripts] | ||
aw-server-rust = "aw_server_rust:main" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import sys | ||
import subprocess | ||
import glob | ||
|
||
def find_rust_binary(): | ||
"""Finds the Rust binary in the target directory.""" | ||
repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
if os.getenv("RELEASE", "") == "false": | ||
target = "debug" | ||
else: | ||
target = "release" | ||
|
||
rust_binary = os.path.join(repo_root, "target", target, "aw-server") | ||
|
||
if os.path.exists(rust_binary): | ||
return rust_binary | ||
|
||
print(f"Error: Rust binary '{rust_binary}' not found. Did you run `cargo build --release`?", file=sys.stderr) | ||
sys.exit(1) | ||
|
||
def main(): | ||
"""Executes the Rust binary and forwards all arguments.""" | ||
rust_binary = find_rust_binary() | ||
subprocess.run([rust_binary] + sys.argv[1:]) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.