From 3a3ab06e2394f776fbd5285ff5a27d07fefb5e1a Mon Sep 17 00:00:00 2001 From: sandyx Date: Mon, 3 Feb 2025 18:08:29 -0600 Subject: [PATCH] install --- install.rb | 3 ++- rub | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/install.rb b/install.rb index 2530d89..9f1ca5a 100644 --- a/install.rb +++ b/install.rb @@ -2,9 +2,10 @@ require 'fileutils' -RUBDIR = "#{Dir.home}/.rub" +RUBDIR = "#{Dir.home}/.rub/" File.mkdir RUBDIR unless File.exist? RUBDIR FileUtils.cp("build.rb", RUBDIR) FileUtils.chmod("+x", "rub") FileUtils.cp("rub", "/usr/local/bin") +FileUtils.cp_r(Dir.pwd, RUBDIR) diff --git a/rub b/rub index a1eaf9f..0d1626e 100755 --- a/rub +++ b/rub @@ -10,8 +10,9 @@ HELP = "\trub init - initialize a new project\n" \ ANSI_RED = "\e[31m" ANSI_CLEAR = "\e[0m" RUB = "#{ANSI_RED}RUB#{ANSI_CLEAR}" +RUBGIT="#{RUB}/rub/" -RUBDIR = "#{Dir.home}/.rub/" +RUBDIR = "#{Dir.home}/.rub/"rub def error(msg) puts "#{RUB}: error: #{msg}" @@ -39,6 +40,10 @@ def rub_init(name) `git branch -m main` end +def rub_update + FileUtils.chdir(RUBGIT) +end + def parse_arg(arg) case arg when "init" @@ -50,6 +55,9 @@ def parse_arg(arg) when "help" puts HELP + when "update" + + end end