Commits

Steve Losh committed 99cbb3d

shelf: Support scripts in subdirectories.

Comments (0)

Files changed (1)

lib/gorilla/guts/shelf.py

     @property
     def installed(self):
         packages = [os.path.join(util.LIB_PATH, p) for p in self.card.packages]
-        scripts = [os.path.join(util.BIN_PATH, s) for s in self.card.scripts]
+        scripts = [os.path.join(util.BIN_PATH, s.split('/')[-1]) for s in self.card.scripts]
         
         packages_installed = all(map(lambda p: os.path.isdir(p), packages))
         scripts_installed = all(map(lambda s: os.path.isfile(s), scripts))
                 dest = os.path.join(util.LIB_PATH, package)
                 os.symlink(source, dest)
             for script in self.card.scripts:
-                source = os.path.join(self.path, script)
-                dest = os.path.join(util.BIN_PATH, script)
+                source = os.path.join(self.path, *script.split('/'))
+                dest = os.path.join(util.BIN_PATH, script.split('/')[-1])
                 os.symlink(source, dest)
         
         for test, expected_output in self.card.tests.iteritems():
     
     def remove(self):
         packages = [os.path.join(util.LIB_PATH, p) for p in self.card.packages]
-        scripts = [os.path.join(util.BIN_PATH, s) for s in self.card.scripts]
+        scripts = [os.path.join(util.BIN_PATH, s.split('/')[-1]) for s in self.card.scripts]
         
         if any(map(lambda p: not os.path.islink(p)
                              or not os.path.isdir(p), packages)):