File tree Expand file tree Collapse file tree 4 files changed +26
-13
lines changed
Expand file tree Collapse file tree 4 files changed +26
-13
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,21 @@ jobs:
4343 uses : crystal-lang/install-crystal@v1
4444 - name : Install shards
4545 run : shards install
46- - name : unix Build
47- if : ${{ !startsWith(matrix.os, 'windows') }}
48- run : just upload
46+ - name : ubuntu Build
47+ if : startsWith(matrix.os, 'ubuntu')
48+ run : |
49+ just static
50+ just upload
51+ - name : macos Build
52+ if : startsWith(matrix.os, 'macos')
53+ run : |
54+ just release
55+ just upload
4956 - name : windows Build
5057 if : startsWith(matrix.os, 'windows')
5158 run : |
5259 C:/msys64/usr/bin/pacman.exe -Sy --noconfirm zip
60+ just static
5361 just upload
5462 - name : Upload Artifact
5563 uses : actions/upload-artifact@v5
Original file line number Diff line number Diff line change 11NAME := " choose"
2- VERSION := " v0.1.1 "
2+ VERSION := " v0.1.2 "
33
44WORKDIR := justfile_directory ()
55GOOS := shell (" go env GOOS" )
@@ -19,18 +19,21 @@ build:
1919release :
2020 shards build --release
2121
22+ static :
23+ shards build --release --static
24+
2225run ARGS = " ": build
2326 cd src/ {{ NAME}} && {{ WORKDIR}} / bin/ {{ NAME}} {{ ARGS }}
2427
25- target : release
28+ target :
2629 mkdir -p target/ {{ TARGETPLATFORM}}
2730 ln -f bin/ {{ NAME}} target/ {{ TARGETPLATFORM}} /
2831 cp -a src/ {{ NAME}} / {{ DATA}} target/ {{ TARGETPLATFORM}} /
2932 # tree target
3033
3134 cd target/ {{ TARGETPLATFORM}} / && ./ {{ NAME}} list
3235
33- upload : release
36+ upload :
3437 mkdir -p upload/ {{ PROGRAM}}
3538 ln -f bin/ {{ NAME}} upload/ {{ PROGRAM}} /
3639 cp -a src/ {{ NAME}} / {{ DATA}} upload/ {{ PROGRAM}} /
@@ -40,7 +43,7 @@ upload: release
4043 cd upload && just zip ' -r {{ PROGRAM}} .zip {{ PROGRAM}} '
4144 cd upload && just sha256 sum ' {{ PROGRAM}} .zip >> {{ PROGRAM}} .sha256sum'
4245
43- upload-single : release
46+ upload-single :
4447 mkdir -p upload
4548 ln -f bin/ {{ NAME}} upload/ {{ PROGRAM}}
4649 # tree upload
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ require "option_parser"
22require " ./choose/license"
33
44module Choose
5- VERSION = " 0.1.1 "
5+ VERSION = " 0.1.2 "
66
77 class Cli
88 @@year : String ?
Original file line number Diff line number Diff line change @@ -25,10 +25,12 @@ class Choose::License
2525
2626 class MoreThanOne < Exception ; end
2727
28- LICENSE_DIR = Path [" _license" ]
29-
3028 @@width = 80
3129
30+ private def self.license_dir
31+ Path .new(Process .executable_path.to_s).parent / " _license"
32+ end
33+
3234 private def self.auto_wrap (str : String , width : Int32 = @@width )
3335 words = str.split(/\s +/ ) # one or more spaces
3436 lines = [] of String
@@ -55,14 +57,14 @@ class Choose::License
5557
5658 def self.glob (pattern : String )
5759 pattern = pattern.downcase
58- if File .exists?(LICENSE_DIR / " #{ pattern } .txt" )
59- return [LICENSE_DIR / " #{ pattern } .txt" ]
60+ if File .exists?(license_dir / " #{ pattern } .txt" )
61+ return [license_dir / " #{ pattern } .txt" ]
6062 end
6163
6264 if ! pattern.ends_with?(" *" )
6365 pattern = pattern + " *"
6466 end
65- Dir .glob(LICENSE_DIR / pattern).map { |x | Path [x] }.sort!
67+ Dir .glob(license_dir / pattern).map { |x | Path [x] }.sort!
6668 end
6769
6870 def self.parse (pattern : String )
You can’t perform that action at this time.
0 commit comments