Sha256: 5bb8e6ee5c58a76d8631e8c68e48bbaf9feae061f704a6a1d77c998f9b9b5799
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true # Copy all installed JavaScript components to the public root. def update require 'fileutils' require 'utopia/path' yarn_package_root = Pathname.new(context.root) + "lib/components" yarn_install_root = Pathname.new(context.root) + "public/_components" yarn_package_root.children.select(&:directory?).collect(&:basename).each do |package_directory| install_path = yarn_install_root + package_directory package_path = yarn_package_root + package_directory dist_path = package_path + 'dist' FileUtils::Verbose.rm_rf(install_path) FileUtils::Verbose.mkpath(install_path.dirname) # If a package has a dist directory, we only symlink that... otherwise we have to do the entire package, and hope that bower's ignore was setup correctly: if dist_path.exist? link_path = Utopia::Path.shortest_path(dist_path, install_path) else link_path = Utopia::Path.shortest_path(package_path, install_path) end FileUtils::Verbose.cp_r File.expand_path(link_path, install_path), install_path end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
utopia-2.13.4 | bake/utopia/yarn.rb |