Created
July 12, 2013 14:14
-
-
Save gimmi/5984766 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, glob, shutil, subprocess | |
base_path = os.path.join(os.getcwd(), 'GesDB') | |
pkgs_path = os.path.join(base_path, 'packages') | |
os.path.relpath('c:\sviluppo\dir\packages', 'c:\sviluppo\dir') | |
for sln_path, directories, files in os.walk(base_path): | |
if not [f for f in files if f.lower().endswith(".sln")]: continue | |
pkgs_rel_path = os.path.relpath(pkgs_path, sln_path) | |
print(sln_path + ' => ' + pkgs_rel_path) | |
cfg_content = """\ | |
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<config> | |
<add key="repositoryPath" value="%s" /> | |
</config> | |
</configuration> | |
""" % pkgs_rel_path | |
with open(os.path.join(sln_path, 'NuGet.config'), 'w') as f: | |
f.write(cfg_content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment