File tree 7 files changed +93
-6
lines changed
7 files changed +93
-6
lines changed Original file line number Diff line number Diff line change 1
- eval $( gimme 1.18.3)
1
+ eval $( gimme 1.20)
2
+ PATH_add dist
Original file line number Diff line number Diff line change 1
1
.idea
2
2
.vscode
3
- goprompt
3
+ dist
Original file line number Diff line number Diff line change
1
+ before :
2
+ hooks :
3
+ - go mod tidy
4
+ builds :
5
+ - main : ./cmd/goprompt
6
+ binary : frk
7
+ env :
8
+ - CGO_ENABLED=0
9
+ goos :
10
+ - linux
11
+ - darwin
12
+ archives :
13
+ - replacements :
14
+ darwin : Darwin
15
+ linux : Linux
16
+ windows : Windows
17
+ 386 : i386
18
+ amd64 : x86_64
19
+ format : binary
20
+ wrap_in_directory : false
21
+
22
+ checksum :
23
+ name_template : ' checksums.txt'
24
+ snapshot :
25
+ name_template : " {{ incpatch .Version }}-next"
26
+
27
+ # yaml-language-server: $schema=https://goreleaser.com/static/schema.json
28
+ # vim: set ts=2 sw=2 tw=0 fo=cnqoj
Original file line number Diff line number Diff line change
1
+ export prefix? =$(HOME ) /.local
2
+ export bindir? =$(prefix ) /bin
3
+
1
4
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST ) ) )
2
5
CURRENT_DIR := $(patsubst % /,% ,$(dir $(MKFILE_PATH ) ) )
3
6
@@ -6,13 +9,22 @@ ZSH_PROMPT_SETUP_SCRIPT := $(CURRENT_DIR)/plugin/zsh/prompt_asynczle_setup.zsh
6
9
USR_BIN_DIR := $(HOME ) /bin
7
10
USR_ZSH_DIR := $(HOME ) /.local/share/zsh-funcs
8
11
12
+ .PHONY : publish
13
+ publish :
14
+ goreleaser release --rm-dist
15
+
16
+ .PHONY : release
17
+ release :
18
+ goreleaser release --rm-dist --snapshot --skip-publish
19
+
20
+ .PHONY : build
9
21
build :
10
- go build -o " goprompt " ./cmd/ goprompt
22
+ goreleaser build --rm-dist --snapshot --single-target --output dist/ goprompt
11
23
12
24
.PHONY : install
13
- install :
25
+ install : build
14
26
mkdir -p " $( USR_BIN_DIR) "
15
- go build -o " $( USR_BIN_DIR) /goprompt" ./cmd/goprompt
27
+ cp dist/goprompt " $( USR_BIN_DIR) /goprompt"
16
28
mkdir -p " $( USR_ZSH_DIR) "
17
29
cp " $( ZSH_PROMPT_SETUP_SCRIPT) " " $( USR_ZSH_DIR) /prompt_asynczle_setup"
18
30
$(MAKE ) setup
@@ -42,3 +54,6 @@ try: install
42
54
@echo ' >> FOR DEVELOPMENT ONLY <<'
43
55
ZSH_DISABLE_PROMPT=Y ZSH_EXTRA_SOURCE=" $( ZSH_PROMPT_SETUP_SCRIPT) " zsh
44
56
57
+ .PHONY : clean
58
+ clean :
59
+ rm -rf dist
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "github.com/spf13/cobra"
6
+ )
7
+
8
+ var (
9
+ cmdInstall = & cobra.Command {
10
+ Use : "install" ,
11
+ Short : "install the integration" ,
12
+ }
13
+ )
14
+
15
+ func init () {
16
+ cmdInstall .RunE = cmdInstallRun
17
+ }
18
+
19
+ // TODO: bundle in the plugin directory, and provide a way to extract it into users directory of choice.
20
+
21
+ func cmdInstallRun (command * cobra.Command , args []string ) error {
22
+ fmt .Println (`
23
+ # SETUP:
24
+ # ------------------------------------------------------------------------------
25
+ # Assuming GoPrompt is installed in $(USR_BIN_DIR)
26
+ # and zsh func in $(USR_ZSH_DIR)
27
+ # ------------------------------------------------------------------------------
28
+ # $$ make setup >> ~/.zshrc"
29
+ # ------------------------------------------------------------------------------
30
+ # Add this to your ~/.zshenv
31
+ # ------------------------------------------------------------------------------
32
+
33
+ # PROMPT_ASYNC_ZLE: ------------------------------------------------------------
34
+ path+=( "$(USR_BIN_DIR)" )
35
+ fpath+=( "$(USR_ZSH_DIR)" )
36
+ autoload -Uz promptinit
37
+ promptinit && prompt_asynczle_setup
38
+ # ------------------------------------------------------------------------------
39
+ ` )
40
+ return nil
41
+ }
Original file line number Diff line number Diff line change 1
1
module github.com/NonLogicalDev/shell.async-goprompt
2
2
3
- go 1.18
3
+ go 1.20
4
4
5
5
require (
6
6
github.com/gookit/color v1.5.1
Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ __zle_async_dispatch() {
126
126
__zle_async_detach " $OLD_ZLE_FD " 2> /dev/null
127
127
fi
128
128
129
+ local ZLE_FD
130
+
129
131
# Create File Descriptor and attach to async command
130
132
exec {ZLE_FD}< <( " ${command[@]} " )
131
133
You can’t perform that action at this time.
0 commit comments