Skip to content

Commit

Permalink
Added config file parameter to init
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Jul 31, 2021
1 parent 88cb2de commit 28b87b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ def __init__(self, template, exc=None, only=None, vars=None,
self.packer = sh.Command(exec_path)
self.packer = self.packer.bake(**kwargs)

def init(self, upgrade=False):
def init(self, config_file, upgrade=False):
"""Executes a `packer init`
:param str config_file: Path to the configuration file
:param bool upgrade: Updates plugins to the latest version
"""
self.packer_cmd = self.packer.init

self._add_opt('-upgrade' if upgrade else None)
self._add_opt(self.template)
self._add_opt(config_file)

return self.packer_cmd()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read(*parts):

setup(
name='python-packer',
version='1.0.2',
version='1.0.3',
url='https://github.com/abhi1693/python-packer',
author='abhi1693',
author_email='desk.abhimanyu@gmail.com',
Expand Down

0 comments on commit 28b87b5

Please sign in to comment.