Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bugfix #73: Fix custom actions to work in any language #74

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion custom_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ func makeCustomActionsHeader() {
var outputActionRegex = regexp.MustCompile(`(?:must)?[o|O]utput(?:OrClipboard)?\((.*?)\)`)
var customActionsHeader strings.Builder
customActionsHeader.WriteString("if ShortcutInput {\n")
customActionsHeader.WriteString(" @_cherri_empty_dictionary: dictionary\n")
customActionsHeader.WriteString(" const _cherri_dictionary_type_name = typeOf(_cherri_empty_dictionary)\n")
customActionsHeader.WriteString(" const _cherri_inputType = typeOf(ShortcutInput)\n")
customActionsHeader.WriteString(" if _cherri_inputType == \"Dictionary\" {\n")
customActionsHeader.WriteString(" if _cherri_inputType == _cherri_dictionary_type_name {\n")
customActionsHeader.WriteString(" const _cherri_input = getDictionary(ShortcutInput)\n")
customActionsHeader.WriteString(" const _cherri_identifier = getValue(_cherri_input, \"cherri_functions\")\n")
customActionsHeader.WriteString(" const _cherri_valid = number(_cherri_identifier)\n")
Expand Down
Loading