Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script now offers a flag to change ignored files #508

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/install_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@
plugins_directory = os.path.abspath(os.path.join(app_path, "plugins"))
found_plugin_argument = False
force_copy = False
exclude_dirs = ['.git', 'raven']
for cnt, commarg in enumerate(sys.argv):
if commarg == "-s":
plugin_dir = os.path.abspath(sys.argv[cnt+1])
found_plugin_argument = True
if commarg == "-f":
force_copy = True
if commarg == "-e":
exclude_str = sys.argv[cnt+1]
# strip out whitespace
exclude_str = "".join(exclude_str.split())
exclude_dirs = exclude_str.split(',')
if not found_plugin_argument:
raise IOError('Source directory for plugin installation not found! USE the syntax "-s path/to/plugin/orginal/location"!')

Expand Down Expand Up @@ -60,6 +66,10 @@
if os.path.exists(destination_plugin):
shutil.rmtree(destination_plugin)
# start copying
shutil.copytree(plugin_dir , destination_plugin ,ignore=shutil.ignore_patterns(".git"))
shutil.copytree(
plugin_dir,
destination_plugin,
ignore=shutil.ignore_patterns(*exclude_dirs)
)
print('Installation of plugin "'+plugin_name+'" performed successfully!')