Skip to content
Permalink
Browse files

Merge pull request conan-io#3468 from Minimonium/feature/add_relative…

…_config_install

Feature/add relative config install
  • Loading branch information...
memsharded committed Sep 4, 2018
2 parents f21e106 + 56f2894 commit 6bd266d0ce61662bcdc268d8e47d040d1d693244
Showing with 20 additions and 1 deletion.
  1. +4 −0 conans/client/conan_api.py
  2. +16 −1 conans/test/command/config_install_test.py
@@ -495,6 +495,10 @@ def config_rm(self, item):

@api_method
def config_install(self, item, verify_ssl, config_type=None, args=None):
# _make_abs_path, but could be not a path at all
if item is not None and os.path.exists(item) and not os.path.isabs(item):
item = os.path.abspath(item)

from conans.client.conf.config_installer import configuration_install
return configuration_install(item, self._client_cache, self._user_io.out, verify_ssl, config_type, args)

@@ -4,7 +4,7 @@
import os
import zipfile
from conans.test.utils.test_files import temp_folder
from conans.util.files import load, save_files, save
from conans.util.files import load, save_files, save, mkdir
from conans.client.remote_registry import RemoteRegistry, Remote
from mock import patch
from conans.client.rest.uploader_downloader import Downloader
@@ -222,6 +222,21 @@ def install_repo_test(self):
self.client.run('config install "%s/.git"' % folder)
self._check("%s/.git" % folder)

def install_repo_relative_test(self):
relative_folder = "./config"
absolute_folder = os.path.join(self.client.current_folder, "config")
mkdir(absolute_folder)
folder = self._create_profile_folder(absolute_folder)
with tools.chdir(folder):
self.client.runner('git init .')
self.client.runner('git add .')
self.client.runner('git config user.name myname')
self.client.runner('git config user.email myname@mycompany.com')
self.client.runner('git commit -m "mymsg"')

self.client.run('config install "%s/.git"' % relative_folder)
self._check(os.path.join("%s" % folder, ".git"))

def install_custom_args_test(self):
""" should install from a git repo
"""

0 comments on commit 6bd266d

Please sign in to comment.
You can’t perform that action at this time.