Skip to content

Commit

Permalink
Windows\Linux packer unpacker for docx
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard93 committed Feb 8, 2017
1 parent 65958c9 commit 6b41b0e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
del %2
set OLDDIR=%CD%
cd %1
zip -r %OLDDIR%\%2 ./
cd %OLDDIR%
7 changes: 7 additions & 0 deletions pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rm -f $2
OLDDIR=$(pwd)
cd $1
zip -r -qq $OLDDIR/$2 ./
cd $OLDDIR
8 changes: 8 additions & 0 deletions unpack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if exist %2 rmdir %2 /s /q
unzip -qq %1 -d %2
set OLDDIR=%CD%
cd %2
for /R %%f in (*.xml *.rels) do (
xmllint --format -o %%f %%f
)
cd %OLDDIR%
12 changes: 12 additions & 0 deletions unpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

rm -rf $2
unzip -qq $1 -d $2
OLDDIR=$(pwd)
cd $2
IFS=$'\n'
for f in $(find -name '*.xml' -or -name '*.rels')
do
xmllint --format -o $f $f
done
cd $OLDDIR

0 comments on commit 6b41b0e

Please sign in to comment.