From b4d832455870f251350b305397cfd7efc037e66f Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 30 May 2019 08:29:58 +0100 Subject: Add a function to check a store path is valid --- lib/guix.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3