Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2022-07-18 02:32:44 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2022-07-20 22:35:22 +0300
commit03d2001cf2ee0bc93d5e413b30387382ec13e1e9 (patch)
tree06a1c32091262e3828ab919cdb642d05cefb40bd /bin
parente7e34a8c24ad6527660e308592117e0a6bd03176 (diff)
Update yarn files for rails 6
Also allow `yarnpkg` binary for `bin/yarn`
Diffstat (limited to 'bin')
-rwxr-xr-xbin/setup3
-rwxr-xr-xbin/yarn12
2 files changed, 12 insertions, 3 deletions
diff --git a/bin/setup b/bin/setup
index 57923026c..90700ac4f 100755
--- a/bin/setup
+++ b/bin/setup
@@ -17,6 +17,9 @@ FileUtils.chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
+ # Install JavaScript dependencies
+ system! 'bin/yarn'
+
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
diff --git a/bin/yarn b/bin/yarn
index 460dd565b..da9264ff5 100755
--- a/bin/yarn
+++ b/bin/yarn
@@ -1,9 +1,15 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
- begin
- exec "yarnpkg", *ARGV
- rescue Errno::ENOENT
+ yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
+ select { |dir| File.expand_path(dir) != __dir__ }.
+ product(["yarn", "yarn.cmd", "yarn.ps1", "yarnpkg"]).
+ map { |dir, file| File.expand_path(file, dir) }.
+ find { |file| File.executable?(file) }
+
+ if yarn
+ exec yarn, *ARGV
+ else
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1