簡體   English   中英

如何使用 Ruby 打包文件

[英]How to Package files using Ruby

我有三個單獨的文件,我想要一個腳本來在本地文件夾中安裝以下文件

包裹物品

https://gitlab.com/darkout/builder/-/raw/master/_data/do-hero-content.yml
https://gitlab.com/darkout/builder/-/raw/master/_includes/do-hero-content.html
https://gitlab.com/darkout/builder/-/raw/master/_sass/modules/do-hero-content.scss

示例代碼示例

install do-hero

應將以上三個文件安裝在本地以下文件夾中

預期輸出:將文件放在本地以下文件夾中

本地 > /_data/do-hero-content.yml

本地 > /_includes/do-hero-content.html

本地 > /_sass/modules/do-hero-content.scss

有人可以告訴我執行此操作的最佳方法是什么嗎?

謝謝肖萬

你可以寫一個Ruby腳本調用install該下載這些文件(調用卷曲或HTTPX ),然后使用文件實用程序將它們復制到你想要的位置:

#!/usr/bin/env ruby

if ARGV[0] == 'do-hero'
  # Write code to download these 3 files and copy to folders you want
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM