-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Support workspaces with
--package
flag
Previously `powerpack` only worked with the root package of a workspace. You can now have multiple packages in a workspace and use the `--package` flag to specify which package to build, link or package. The `workflow/` directory containing the package information must be in the same directory as the manifest file for the particular package.
- Loading branch information
1 parent
beb2820
commit bedcc28
Showing
9 changed files
with
251 additions
and
54 deletions.
There are no files selected for viewing
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
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
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
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 @@ | ||
workflow/hello-alfred |
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,8 @@ | ||
[package] | ||
name = "hello-alfred" | ||
version = "0.0.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
powerpack = { path = "../.." } |
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,13 @@ | ||
# hello-alfred | ||
|
||
This is an example workflow built using `powerpack`. | ||
|
||
Use the `build` command to build this example. | ||
```sh | ||
cargo run --package powerpack-cli -- build --release | ||
``` | ||
|
||
Now use the `link` command to symlink to Alfred. | ||
```sh | ||
cargo run --package powerpack-cli -- link | ||
``` |
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,38 @@ | ||
use std::env; | ||
use std::error::Error; | ||
use std::io; | ||
use std::time::Duration; | ||
|
||
use powerpack::*; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
// Alfred passes in a single argument for the user query. | ||
let query = env::args().nth(1); | ||
|
||
// Create an item to show in the Alfred drop down. | ||
let item = Item::new("Hello World!") | ||
.subtitle(format!("Your query was '{query:?}'")) | ||
.uid("unique identifier") | ||
.arg("/path/to/file.jpg") | ||
.icon(Icon::with_type("public.jpeg")) | ||
.valid(true) | ||
.matches("use this to filter") | ||
.autocomplete("to this") | ||
.kind(Kind::FileSkipCheck) | ||
.copy_text("this text will be copied with ⌘C") | ||
.large_type_text("this text will be displayed with ⌘L") | ||
.modifier(Modifier::new(Key::Command).subtitle("⌘ changes the subtitle")) | ||
.modifier(Modifier::new(Key::Option).arg("/path/to/modified.jpg")) | ||
.modifier(Modifier::new(Key::Control).icon(Icon::with_image("/path/to/file.png"))) | ||
.modifier(Modifier::new(Key::Shift).valid(false)) | ||
.quicklook_url("https://example.com"); | ||
|
||
// Output the item to Alfred! | ||
Output::new() | ||
.rerun(Duration::from_secs(1)) | ||
.skip_knowledge(true) | ||
.items([item]) | ||
.write(io::BufWriter::new(io::stdout()))?; | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.