Skip to content

Commit

Permalink
Merge pull request #16 from mauritssilvis/html_darts_tables
Browse files Browse the repository at this point in the history
Add HTML darts checkout tables
  • Loading branch information
mauritssilvis authored Mar 21, 2023
2 parents 00775b1 + a44fbf1 commit 6ee4d83
Show file tree
Hide file tree
Showing 31 changed files with 31,690 additions and 165 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Finally, `darts` can provide output in several formats: easily readable Markdown

Currently, `darts` is available as a Java-based command-line application.
More information about the installation and use of this app can be found in the [Java-based command-line interface](cli/java-darts-cli) readme.
If you are interested in checking out those checkout tables, refer to the [Markdown checkout tables](tables/md-darts-tables).
If you are interested in checking out those checkout tables, refer to the [Markdown](tables/md-darts-tables) or the [HTML checkout tables](tables/html-darts-tables).

## License

Expand Down
41 changes: 41 additions & 0 deletions scripts/do-tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

# Check project identifier
if [ $# -eq 0 ] || [ "${1}" = "" ]; then
echo "Error: No project identifier supplied."
exit
fi

id=${1}

if [ ! -f "${id}-properties" ]; then
echo "Error: No properties found for project identifier ${id}."
exit
fi

# Check version
if [ $# -eq 0 ] || [ "${2}" = "" ]; then
echo "Error: No version supplied."
exit
fi

version=${2}

# Check branch
branch=$(git rev-parse --abbrev-ref HEAD)

if [ "${branch}" != "main" ]; then
echo "Error: Not on main branch."
exit
fi

# Get properties
# shellcheck source=java-darts-properties
. "./${id}-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
80 changes: 80 additions & 0 deletions scripts/do-zip
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/sh

# Check project identifier
if [ $# -eq 0 ] || [ "${1}" = "" ]; then
echo "Error: No project identifier supplied."
exit
fi

id=${1}

if [ ! -f "${id}-properties" ]; then
echo "Error: No properties found for project identifier ${id}."
exit
fi

# Check version
if [ $# -eq 0 ] || [ "${2}" = "" ]; then
echo "Error: No version supplied."
exit
fi

version=${2}

# Check branch
branch=$(git rev-parse --abbrev-ref HEAD)

if [ "${branch}" != "main" ]; then
echo "Warning: Not on main branch."
fi

# Get properties
# shellcheck source=java-darts-properties
. "./${id}-properties"

# Clone repository
cd ..
git clone . "../darts-${version}" 2>/dev/null
cd "../darts-${version}" || exit

# Clean up
rm -rf .git
rm -rf scripts
find . -maxdepth 1 -name "*.md" -delete

for i in "${!other_files[@]}"; do
other_path="${other_files[i]}"
rm -rf "${other_path}"
done

# 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 $((${#labels[@]} * 3)) ]; then
echo "Error: Not all archives were created successfully."
exit
fi
22 changes: 22 additions & 0 deletions scripts/html-darts-tables-properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Project names
name_prefix="HTML darts"

names=(
"tables"
)

# Project labels
label_prefix="html-darts"

labels=(
"tables"
)

# Other files
other_files=(
"api"
"cli"
"core"
)
7 changes: 7 additions & 0 deletions scripts/html-darts-tables-tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Set project identifier
id="html-darts-tables"

# Tag
./do-tag "${id}" "${1}"
7 changes: 7 additions & 0 deletions scripts/html-darts-tables-zip
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Set project identifier
id="html-darts-tables"

# Zip
./do-zip "${id}" "${1}"
5 changes: 5 additions & 0 deletions scripts/java-darts-properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ labels=(
"core"
"cli"
)

# Other files
other_files=(
"tables"
)
26 changes: 3 additions & 23 deletions scripts/java-darts-tag
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
#!/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
. ./java-darts-properties
# Set project identifier
id="java-darts"

# Tag
for i in "${!names[@]}"; do
message="${name_prefix} ${names[i]} ${version}"
tag="${label_prefix}-${labels[i]}-${version}"
git tag -am "${message}" "${tag}"
done
./do-tag "${id}" "${1}"
61 changes: 3 additions & 58 deletions scripts/java-darts-zip
Original file line number Diff line number Diff line change
@@ -1,62 +1,7 @@
#!/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
. ./java-darts-properties

# Clone repository
cd ..
git clone . "../darts-${version}" 2>/dev/null
cd "../darts-${version}" || exit

# Clean up
rm -rf .git
rm -rf scripts
rm -rf tables
find . -maxdepth 1 -name "*.md" -delete
# Set project identifier
id="java-darts"

# 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 9 ]; then
echo "Error: Not all archives were created successfully."
exit
fi
./do-zip "${id}" "${1}"
8 changes: 8 additions & 0 deletions scripts/md-darts-tables-properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ label_prefix="md-darts"
labels=(
"tables"
)

# Other files
other_files=(
"api"
"cli"
"core"
)

26 changes: 3 additions & 23 deletions scripts/md-darts-tables-tag
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
#!/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
# Set project identifier
id="md-darts-tables"

# Tag
for i in "${!names[@]}"; do
message="${name_prefix} ${names[i]} ${version}"
tag="${label_prefix}-${labels[i]}-${version}"
git tag -am "${message}" "${tag}"
done
./do-tag "${id}" "${1}"
63 changes: 3 additions & 60 deletions scripts/md-darts-tables-zip
Original file line number Diff line number Diff line change
@@ -1,64 +1,7 @@
#!/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
# Set project identifier
id="md-darts-tables"

# 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
./do-zip "${id}" "${1}"
1 change: 1 addition & 0 deletions tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This part of the [darts](https://github.com/mauritssilvis/darts) project provide
Currently, checkout tables are available in the following formats:

- [Markdown](md-darts-tables)
- [HTML](html-darts-tables)

## License

Expand Down
Loading

0 comments on commit 6ee4d83

Please sign in to comment.