snippet_cli 0.1.8 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Setup.rb +7 -7
- data/lib/snippet_cli/commands/new.rb +2 -2
- data/lib/snippet_cli/commands/setup.rb +1 -1
- data/lib/snippet_cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef970184ca46c2d009feb5b35a23cf83b258a63aee81e1b3a61259ae2c7b0ccf
|
4
|
+
data.tar.gz: 06f97fc1903a6eaed6c8280d04db9e46d588818916dee30cbf600eb4c786cc73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d13812aa194e42b1f185d890212825b99f58f135eaa632cd989f29e2bb24e537e0fae8b1b73607756b5da1802550788919856e94241f7c6792166a832ecc708
|
7
|
+
data.tar.gz: d3f1c06832065c52e40b2d96503e2447f3d2112660c79a33e44ecbeee557afd8387fa870f0a7b15d8f0938e84f595cdf1aa46080c2ec806d4dffd38468f6f346
|
data/lib/Setup.rb
CHANGED
@@ -37,9 +37,9 @@ class Setup
|
|
37
37
|
if (config_path.include? "Windows")
|
38
38
|
return config_path = "\\Roaming\\AppData\\espanso\\default.yml"
|
39
39
|
elsif (config_path.include?"OS X")
|
40
|
-
return config_path = "
|
40
|
+
return config_path = "#{ENV["HOME"]}/Library/Preferences/espanso/default.yml"
|
41
41
|
else config_path.include?("Linux")
|
42
|
-
return config_path = "
|
42
|
+
return config_path = "#{ENV["HOME"]}/.config/espanso/default.yml"
|
43
43
|
end
|
44
44
|
puts @leading
|
45
45
|
self.user_os=config_path
|
@@ -62,13 +62,13 @@ class Setup
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def generate_config()
|
65
|
-
if File.exist?("
|
65
|
+
if File.exist?("#{ENV["HOME"]}/snippet_cli_config.txt") then
|
66
66
|
|
67
67
|
else
|
68
|
-
File.open("
|
69
|
-
File.open("
|
70
|
-
File.open("
|
71
|
-
File.open("
|
68
|
+
File.open("#{ENV["HOME"]}/snippet_cli_config.txt", "a") { |f| f.write "NAME = #{self.user_name}\n"}
|
69
|
+
File.open("#{ENV["HOME"]}/snippet_cli_config.txt", "a") { |f| f.write "OS = #{self.user_os}\n"}
|
70
|
+
File.open("#{ENV["HOME"]}/snippet_cli_config.txt", "a") { |f| f.write "STORAGE = #{self.user_storage}\n"}
|
71
|
+
File.open("#{ENV["HOME"]}/snippet_cli_config.txt", "a") { |f| f.write "CONFIG_PRESENT = TRUE\n"}
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'tty-box'
|
4
4
|
require 'tty-prompt'
|
5
|
-
require_relative '
|
5
|
+
require_relative '../../snippet_generator'
|
6
6
|
require 'httparty'
|
7
7
|
require 'json'
|
8
8
|
require 'ascii'
|
@@ -33,7 +33,7 @@ module SnippetCli
|
|
33
33
|
prompt=TTY::Prompt.new
|
34
34
|
def initialize(options)
|
35
35
|
@options = options
|
36
|
-
@file_path = File.readlines("#{ENV["
|
36
|
+
@file_path = File.readlines("#{ENV["HOME"]}/snippet_cli_config.txt")[1]
|
37
37
|
@file_path = Ascii.process(@file_path)
|
38
38
|
end
|
39
39
|
|
@@ -55,7 +55,7 @@ module SnippetCli
|
|
55
55
|
elsif (platform.mac? == true)
|
56
56
|
config_path = "#{ENV["HOME"]}/Library/Preferences/espanso/default.yml"
|
57
57
|
else (platform.linux? == true)
|
58
|
-
config_path = "#{ENV["
|
58
|
+
config_path = "#{ENV["HOME"]}/.config/espanso/default.yml"
|
59
59
|
end
|
60
60
|
puts @leading
|
61
61
|
self.config_path=config_path
|
data/lib/snippet_cli/version.rb
CHANGED