-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from mauritssilvis/md_darts_tables_fixes
Fix and streamline the Markdown checkout table project
- Loading branch information
Showing
22 changed files
with
333 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
# Project names | ||
name_prefix="Markdown darts" | ||
|
||
names=( | ||
"tables" | ||
) | ||
|
||
# Project labels | ||
label_prefix="md-darts" | ||
|
||
labels=( | ||
"tables" | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# Check version | ||
if [ $# -eq 0 ]; then | ||
echo "Error: No version supplied." | ||
exit | ||
fi | ||
|
||
version=${1} | ||
|
||
# Check branch | ||
branch=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "${branch}" != "main" ]; then | ||
echo "Error: Not on main branch." | ||
exit | ||
fi | ||
|
||
# Get properties | ||
. ./md-darts-tables-properties | ||
|
||
# Tag | ||
for i in "${!names[@]}"; do | ||
message="${name_prefix} ${names[i]} ${version}" | ||
tag="${label_prefix}-${labels[i]}-${version}" | ||
git tag -am "${message}" "${tag}" | ||
done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/sh | ||
|
||
# Check version | ||
if [ $# -eq 0 ]; then | ||
echo "Error: No version supplied." | ||
exit | ||
fi | ||
|
||
version=${1} | ||
|
||
# Check branch | ||
branch=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "${branch}" != "main" ]; then | ||
echo "Warning: Not on main branch." | ||
fi | ||
|
||
# Get properties | ||
. ./md-darts-tables-properties | ||
|
||
# Clone repository | ||
cd .. | ||
git clone . "../darts-${version}" 2>/dev/null | ||
cd "../darts-${version}" || exit | ||
|
||
# Clean up | ||
rm -rf .git | ||
rm -rf api | ||
rm -rf cli | ||
rm -rf core | ||
rm -rf scripts | ||
find . -maxdepth 1 -name "*.md" -delete | ||
|
||
# Zip | ||
echo -n "" > "zip.log" | ||
|
||
for i in "${!labels[@]}"; do | ||
label="${labels[i]}" | ||
project="${label_prefix}-${label}" | ||
path="${label}/${project}" | ||
file="${project}-${version}" | ||
|
||
mv "${path}" "${project}" 2>/dev/null | ||
rm -rf "${label}" | ||
rm -rf "${project}/.idea" | ||
|
||
# .tar.gz | ||
rm -f "${file}.tar.gz" | ||
7z a "${file}.tar" "./${project}/*" >> "zip.log" 2>> "zip.log" | ||
7z a -mx9 "${file}.tar.gz" "${file}.tar" >> "zip.log" 2>> "zip.log" | ||
rm -f "${file}.tar" | ||
|
||
# .zip | ||
rm -f "${file}.zip" | ||
7z a -mx9 "${file}.zip" "./${project}/*" >> "zip.log" 2>> "zip.log" | ||
done | ||
|
||
# Check zip | ||
archives=$(grep "Everything is Ok" zip.log -c) | ||
|
||
if [ "${archives}" -ne 3 ]; then | ||
echo "Error: Not all archives were created successfully." | ||
exit | ||
fi |
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# darts > Tables > Markdown | ||
# Markdown checkout tables | ||
|
||
> Darts checkout tables in the Markdown format | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Oops, something went wrong.