繁体   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