Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Nov 3, 2023
1 parent 26ffbcc commit b177a8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ Sunbeam provides multiple helpers for writing scripts in POSIX shell, but you ca
The only requirement is that your language of choice can read and write JSON.

Creating a new extension is as easy as writing a script.
You can share your scripts with others by just hosting them on a public url.

Example Extensions:

- [VS Code (typescript)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/vscode.ts)
- [File Browser (python)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/files.py)
- [Bitwarden (sh)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/bitwarden.sh)
- [Github (sh)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/github.sh)
- [TLDR Pages (sh)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/tldr.sh)
- [Devdocs (sh)](https://github.com/pomdtr/sunbeam-extensions/tree/main/extensions/devdocs.sh)
You can share your scripts with others by just hosting them on a public url.

## Integrates with your favorite apps

Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,15 @@ func ExtensionRootItems(alias string, extension extensions.Extension) []types.Li
if extension.Type == extensions.ExtensionTypeLocal {
listItem.Actions = append(listItem.Actions, types.Action{
Title: "Edit",
Key: "e",
Type: types.ActionTypeEdit,
Target: extension.Entrypoint,
})
}

listItem.Actions = append(listItem.Actions, types.Action{
Title: "Copy Origin",
Key: "c",
Type: types.ActionTypeCopy,
Target: extension.Origin,
})
Expand Down
11 changes: 7 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (typ
Key: "c",
Type: types.ActionTypeCopy,
Text: item.Command,
Exit: true,
},
},
}, nil
Expand Down Expand Up @@ -183,7 +182,6 @@ func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (typ
Key: "c",
Type: types.ActionTypeCopy,
Text: item.Command,
Exit: true,
},
},
}, nil
Expand All @@ -208,7 +206,6 @@ func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (typ
Key: "c",
Type: types.ActionTypeCopy,
Text: item.Command,
Exit: true,
},
},
}, nil
Expand All @@ -234,7 +231,7 @@ func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (typ
}

return types.ListItem{
Id: fmt.Sprintf("root - %s", item.Title),
Id: fmt.Sprintf("%s - %s", alias, item.Title),
Title: item.Title,
Subtitle: extension.Title,
Accessories: []string{alias},
Expand All @@ -247,6 +244,12 @@ func (c Config) RootItem(item RootItem, extensions extensions.ExtensionMap) (typ
Params: params,
Exit: true,
},
{
Title: "Copy Command",
Key: "c",
Type: types.ActionTypeCopy,
Text: item.Command,
},
},
}, nil
}
Expand Down

0 comments on commit b177a8d

Please sign in to comment.