-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
executable file
·39 lines (32 loc) · 931 Bytes
/
Copy pathinstall.ps1
File metadata and controls
executable file
·39 lines (32 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env pwsh
# Usage:
# UNIX-like:
# sh install.ps1
# Windows: Copy everything in this file and paste it into PowerShell to run.
#
# Description: install cinnabar and copy to cache dir
# Note: Although the shebang is `pwsh`, you can run it with POSIX sh.
# Depends: ruby (>= 3.1)
gem install cinnabar
ruby -r pathname -r cinnabar -r fileutils -e "
gem = 'cinnabar'
env_dir = ENV['xdg_cache_home'.upcase]
cache_dir =
case env_dir
when nil, ''
Pathname(Dir.home).join('.cache')
else Pathname(env_dir)
end
.join('ruby')
.tap(&:mkpath)
copy_to_cache_dir = ->src { FileUtils.cp_r src, cache_dir, verbose: true }
lib_dir = Cinnabar::GemPathCore
.find_lib_paths(gem)
.first
firb = File.expand_path('../misc/firb', lib_dir)
[lib_dir, firb]
.each(©_to_cache_dir)
puts '========='
print 'Path: '
puts File.expand_path('firb/bin', cache_dir)
"