Add basic composer.install() function

This commit is contained in:
Lance Edgar 2022-11-01 18:42:11 -05:00
parent 614fd92a20
commit 46440b6a95

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2019 Lance Edgar
# Copyright © 2010-2022 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,14 +24,19 @@
Fabric lib for Composer (PHP dependency manager)
"""
from __future__ import unicode_literals, absolute_import
from rattail_fabric2 import make_deploy, exists
from rattail_fabric2 import apt, make_deploy, exists
deploy = make_deploy(__file__)
def install(c, with_apt=True):
if with_apt:
apt.install(c, 'composer')
else:
install_globally(c)
def install_globally(c):
"""
Install `composer.phar` in global location