Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

3 years ago
  1. set -e
  2. cd ..
  3. # extract version number from main unit
  4. VERSION_STR=$(grep -oP "(?<=SAppTitle = 'Deskew )([0-9\.]+)" MainUnit.pas)
  5. ZIP_NAME=Deskew-$VERSION_STR.zip
  6. RELEASE_DIR=_internal/Release-CLI
  7. CONTENTS_DIR=$RELEASE_DIR/Deskew
  8. rm -rf $RELEASE_DIR/*
  9. mkdir -p $CONTENTS_DIR
  10. # clone sources (without .hg folder)
  11. hg archive -t files $CONTENTS_DIR
  12. rm $CONTENTS_DIR/.hg*
  13. # copy binaries to release folder (must be prebuilt - no platfrom where we could cross-compile all atm)
  14. cp Bin/deskew $CONTENTS_DIR/Bin
  15. cp Bin/deskew.exe $CONTENTS_DIR/Bin
  16. cp Bin/deskew32.exe $CONTENTS_DIR/Bin
  17. cp Bin/deskew-mac $CONTENTS_DIR/Bin
  18. cp Bin/deskew-arm $CONTENTS_DIR/Bin
  19. chmod 755 $CONTENTS_DIR/Bin/deskew*
  20. # build the ZIP (in Linux/WSL so the exe permissions are presserved)
  21. cd $RELEASE_DIR
  22. zip -r -9 -q $ZIP_NAME Deskew
  23. # check expected contents
  24. OUTPUT=$(unzip -Z $ZIP_NAME)
  25. echo "$OUTPUT" | grep -q "^-r.xr.xr.x.*unx.*deskew$"
  26. echo "$OUTPUT" | grep -q "^-r.xr.xr.x.*unx.*deskew-mac$"
  27. echo "$OUTPUT" | grep -q "^-r.xr.xr.x.*unx.*deskew-arm$"
  28. echo "Finished OK with $RELEASE_DIR/$ZIP_NAME!"