actions.py 806 B

123456789101112131415161718192021
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import get
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. def install():
  10. shelltools.system("npm install -g --prefix %s/usr" % get.installDIR())
  11. # Make a copy that changes symlinks to hard copies
  12. shelltools.system("rsync --archive --verbose --copy-links %s/usr/lib/node_modules/ %s/usr/lib/node_modules_cp/" % (get.installDIR(), get.installDIR()))
  13. # Remove and replace
  14. pisitools.removeDir("/usr/lib/node_modules/")
  15. shelltools.system("mv %s/usr/lib/node_modules_cp/ %s/usr/lib/node_modules/" % (get.installDIR(), get.installDIR()))
  16. pisitools.dodoc("LICENSE", "README*")