From 7b2023d028f0a1cf3de3f19a7d53a904c80804b4 Mon Sep 17 00:00:00 2001 From: Arian Weber Date: Sun, 11 Feb 2024 17:46:35 +0100 Subject: [PATCH] Fix init command --- lib/pg-tools/cli/cli.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pg-tools/cli/cli.rb b/lib/pg-tools/cli/cli.rb index 0a08de3..d862889 100644 --- a/lib/pg-tools/cli/cli.rb +++ b/lib/pg-tools/cli/cli.rb @@ -199,12 +199,12 @@ def init() files.each { |f| target_file = File.join(target, f.sub(template_dir, "")) target_file = target_file.gsub(".resource", "") - FileUtils.mkdir_p(File.dirname(target)) - FileUtils.cp(f, target) unless File.basename(f) == ".keep" + FileUtils.mkdir_p(File.dirname(target_file)) + FileUtils.cp(f, target_file) unless File.basename(f) == ".keep" } # Copy the actual default config into the project as that # will contain all keys and should be commented - FileUtils.cp(File.join(PgTools.root, "data", "config", "pg-tools.yml"), File.join("template_dir", ".pg-tools.yml")) + FileUtils.cp(File.join(PgTools.root, "data", "config", "pg-tools.yml"), File.join(target, ".pg-tools.yml")) # Initialize git project Dir.chdir(target) {