Skip to content

Commit

Permalink
ws bin
Browse files Browse the repository at this point in the history
  • Loading branch information
codeitlikemiley committed Dec 19, 2023
1 parent 9e7919d commit ebd8158
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: ws-cli
bin: ws
# (optional) Target triple, default is host triple.
target: ${{ matrix.target }}
# (required) GitHub token for uploading assets to GitHub Releases.
Expand Down
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,33 @@ license = "MIT"
keywords = ["workspace", "cli", "cargo"]
categories = ["command-line-utilities", "development-tools::cargo-plugins"]

# use in Github workflow `release`
[[bin]]
name = "ws"
path = "src/main.rs"

# Used when Bunding for OSX
[[bin]]
name = "ws-cli"
path = "src/main.rs"


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.11", features = ["cargo", "derive", "string"] }
toml_edit = "0.21.0"

# Used when Bunding for OSX
[package.metadata.bundle]
name = "ws-cli" # The name of your application
identifier = "com.codeitlikemiley.ws-cli" # The bundle identifier of your application
name = "ws" # The name of your application
identifier = "com.codeitlikemiley.ws" # The bundle identifier of your application
copyright = "Copyright (c) codeitlikemiley 2023. All rights reserved."
category = "Developer Tool"
short_description = "A Workspace CLI for managing GRPC Server Workspace"
long_description = "A Workspace CLI for managing GRPC Server Workspace"
version = "0.1.0" # Version of your application
osx_url_schemes = ["com.codeitlikemiley.ws-cli"]
osx_url_schemes = ["com.codeitlikemiley.ws"]
script = "scripts/postinstall" # Path to your postinstall script

[profile.release]
Expand Down
4 changes: 2 additions & 2 deletions provision.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

cargo clean
rm ws-cli.pkg
rm ws.pkg
cargo zigbuild --release
cargo bundle --release
pkgbuild --root ./target/release/bundle/osx/ws-cli.app --install-location "/Applications/ws-cli.app" --identifier com.codeitlikemiley.ws-cli --version 0.1.0 --scripts ./scripts ws-cli.pkg
pkgbuild --root ./target/release/bundle/osx/ws.app --install-location "/Applications/ws.app" --identifier com.codeitlikemiley.ws --version 0.1.0 --scripts ./scripts ws.pkg
2 changes: 1 addition & 1 deletion scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ if [ -L "$USER_HOME/.local/bin/ws" ]; then
fi

# Create the symlink in ~/.local/bin
ln -s "/Applications/ws-cli.app/Contents/MacOS/ws-cli" "$USER_HOME/.local/bin/ws"
ln -s "/Applications/ws.app/Contents/MacOS/ws-cli" "$USER_HOME/.local/bin/ws"

0 comments on commit ebd8158

Please sign in to comment.