Skip to content

Instantly share code, notes, and snippets.

@vaskaloidis
Last active November 18, 2016 10:03
Show Gist options
  • Select an option

  • Save vaskaloidis/deeb0282e6655abd4c0d652f68966dd3 to your computer and use it in GitHub Desktop.

Select an option

Save vaskaloidis/deeb0282e6655abd4c0d652f68966dd3 to your computer and use it in GitHub Desktop.
Python script that parses a Liferay .gitignore file, and runs an svn:ignore against each row (file, file-type or dir) in the .gitignore file.
#! /usr/bin/python
#
# Build the entire ISAAC Project
import subprocess
import os
import sys
#args.extend(['package'])
defaultArgs = ['propset', 'svn:ignore']
def runthis(argumentsParam):
return subprocess.check_call(['svn'] + argumentsParam)
with open('./liferay-ignore.txt', 'r') as f:
for x in f:
x = x.rstrip()
if not x: continue
args = None
args = defaultArgs
y = '"' + x + '"'
args.extend([y])
print("Build Arguments")
print(args)
# runthis(args)
otherArgs = ['propset', 'svn:ignore']
newArgs = otherArgs
y = '"' + x + '"'
newArgs.extend([y])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment