forked from flightpkg/flight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flight.rb
28 lines (24 loc) · 981 Bytes
/
flight.rb
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
require "language/node"
require 'fileutils'
class Flight < Formula
desc "Flight homebrew formula."
homepage "https://flightpkg.js.org"
url "https://github.com/flightpkg/flight/archive/refs/tags/v0.0.5.zip"
version "v0.0.5"
sha256 "c56d37a87a33b921b9feb29c15980dfc549606a2afb11578ba8aa52c67bb1c23"
license "Apache-2.0"
depends_on "node"
def install
FileUtils.mkdir_p '../../../usr/local/flight'
origin = Dir.getwd
destination = '../../../usr/local/flight'
Dir.glob(File.join(origin, '*')).each do |file|
if File.exists? File.join(destination, File.basename(file))
FileUtils.move file, File.join(destination, "1-#{File.basename(file)}")
else
FileUtils.move file, File.join(destination, File.basename(file))
end
end
system `export FLIGHT_DIR='export FLIGHT_HOME="~/usr/local/flight/dist/js"' ; echo $FLIGHT_DIR >> ~/.bashrc ; . ~/.bashrc ; echo 'export PATH=$FLIGHT_HOME:$PATH' >> ~/.bashrc`
end
end