aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-30 08:29:58 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-30 08:33:03 +0100
commitb4d832455870f251350b305397cfd7efc037e66f (patch)
tree73ffd51ecab05106c5cb8991188a1a1696cc7e20 /lib
parent859302774c4d719cf949f419d0efcfd8cbad6ca2 (diff)
downloadgovuk-mini-environment-admin-b4d832455870f251350b305397cfd7efc037e66f.tar
govuk-mini-environment-admin-b4d832455870f251350b305397cfd7efc037e66f.tar.gz
Add a function to check a store path is valid
Diffstat (limited to 'lib')
-rw-r--r--lib/guix.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/guix.rb b/lib/guix.rb
index a9cc7b0..a228ce4 100644
--- a/lib/guix.rb
+++ b/lib/guix.rb
@@ -22,4 +22,8 @@ module Guix
def self.available_locally?
File.exist?('/var/guix/daemon-socket/socket')
end
+
+ def self.valid_store_path?(path)
+ path.starts_with?('/gnu/store/') && !path.match(/\s/)
+ end
end