alm 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/alm +4 -5
- data/lib/alm/modules.rb +2 -2
- data/lib/alm/verifications.rb +1 -0
- data/lib/alm/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: 8337f31b68a5463669e828e49b6482c7ee93cc38f3c7416038d1ee9264540345
|
|
4
|
+
data.tar.gz: 36f086e0dc41039beb2e14d39e46373f4b51a32dc1d4b3cfc00583cada972f5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5552441af2fea26b5f1a019de25fc53e0d469a158967659e64087781209c3e931bf687c16cff126efc36124abdaa960ff188a7b3fced7e2062c2e7e1387f88f9
|
|
7
|
+
data.tar.gz: 68bfab78dab387b562ef3a01574b533d5910230e756e6cf1a8bef4f3c3c337b81cd75718746e71dbf6ab3e0b0bf8fd2e8e3a2bec587d2b3565997386634b87c1
|
data/exe/alm
CHANGED
|
@@ -39,14 +39,13 @@ unless options[:file]
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
file = options[:file]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
appimg_dir = File.expand_path(file, "#{Dir.home}/.local/appimage")
|
|
42
|
+
appimg_dir = File.join(Dir.home, ".local", "appimage")
|
|
43
|
+
file_path = File.join(appimg_dir, File.basename(file))
|
|
45
44
|
|
|
46
45
|
case options[:action]
|
|
47
46
|
when :add
|
|
48
47
|
# ADD VERIFICATION PROCESS
|
|
49
|
-
avp_verification = Verifications::AVP.process(
|
|
48
|
+
avp_verification = Verifications::AVP.process(file)
|
|
50
49
|
case avp_verification
|
|
51
50
|
when :AVP_PPR
|
|
52
51
|
Modules::ADD.start([file])
|
|
@@ -64,7 +63,7 @@ when :remove
|
|
|
64
63
|
when :RVP_PPR
|
|
65
64
|
Modules::REMOVE.start([file])
|
|
66
65
|
when :RVP_NEXIST
|
|
67
|
-
puts "\e[31m[ERROR | RVP_NEXIST ] - alm: File #{file} not found in
|
|
66
|
+
puts "\e[31m[ERROR | RVP_NEXIST ] - alm: File #{file} not found in #{appimg_dir}\e[0m"
|
|
68
67
|
else
|
|
69
68
|
puts "\e[31m[ERROR | RVP_FAILED ] - alm: RVP Verification failed unexpectedly\e[0m"
|
|
70
69
|
end
|
data/lib/alm/modules.rb
CHANGED
|
@@ -31,7 +31,7 @@ module Modules
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
if system("mv '#{file_path}' '#{appimg_path}'")
|
|
34
|
-
puts ">>> - alm: #{file_arg} successfully added to #{appimg_path}\n"
|
|
34
|
+
puts ">>> - alm: #{file_arg} successfully added to #{appimg_path} \n\n"
|
|
35
35
|
else
|
|
36
36
|
puts "\e[31m[ERROR | RUNTIME_ERROR] - alm: Failed to move #{file_arg} to #{appimg_path}\e[0m"
|
|
37
37
|
end
|
|
@@ -53,7 +53,7 @@ module Modules
|
|
|
53
53
|
|
|
54
54
|
begin
|
|
55
55
|
File.delete(file_path)
|
|
56
|
-
puts "\n>>> - alm: #{File.basename(file_arg)} successfully removed from #{appimg_path}\n"
|
|
56
|
+
puts "\n>>> - alm: #{File.basename(file_arg)} successfully removed from #{appimg_path} \n\n"
|
|
57
57
|
rescue Errno::EACCES
|
|
58
58
|
puts "\e[31m[ERROR | PERMISSION] - alm: Permission denied while trying to delete #{file_path}\e[0m"
|
|
59
59
|
rescue => e
|
data/lib/alm/verifications.rb
CHANGED
|
@@ -3,6 +3,7 @@ module Verifications
|
|
|
3
3
|
class AVP
|
|
4
4
|
def self.process(path)
|
|
5
5
|
return :AVP_NEXIST unless File.exist?(path)
|
|
6
|
+
return :AVP_NAPPIMG unless File.file?(path)
|
|
6
7
|
return :AVP_NAPPIMG unless path.downcase.end_with?(".appimage") || File.read(path, 4)&.start_with?("\x7FELF")
|
|
7
8
|
:AVP_PPR # Add Verification Process (Positive Process Return)
|
|
8
9
|
end
|
data/lib/alm/version.rb
CHANGED