Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.wordguessing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
org.benoitharrault.wordguessing
Commits
9d310c99
Commit
9d310c99
authored
4 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Plain Diff
Merge branch '31-build-keywords-images-board-html' into 'master'
Resolve "Build keywords images board (html)" Closes
#31
See merge request
!31
parents
12a38bc0
7b72ada6
No related branches found
No related tags found
1 merge request
!31
Resolve "Build keywords images board (html)"
Pipeline
#1087
passed
4 years ago
Stage: update
Stage: build-debug
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/03_optimize_images.sh
+4
-1
4 additions, 1 deletion
scripts/03_optimize_images.sh
scripts/04_build_images_board.sh
+53
-0
53 additions, 0 deletions
scripts/04_build_images_board.sh
scripts/05_build_assets_list.sh
+0
-0
0 additions, 0 deletions
scripts/05_build_assets_list.sh
with
57 additions
and
1 deletion
scripts/03_optimize_images.sh
+
4
−
1
View file @
9d310c99
...
...
@@ -16,11 +16,14 @@ CONVERT_OPTIONS="-alpha off +dither -colors 256 -depth 4"
OPTIPNG_OPTIONS
=
"-preserve -quiet -o7"
# delete
empty/temp files
echo
"Cleaning
empty/temp files
..."
find
"
${
IMAGES_CACHE_FOLDER
}
"
-type
f
-name
"*.png"
-empty
-exec
rm
{}
\;
find
"
${
IMAGES_CACHE_FOLDER
}
"
-type
f
-name
"*.tmp*"
-exec
rm
{}
\;
find
"
${
IMAGES_CACHE_FOLDER
}
"
-type
d
-empty
-exec
rm
-rf
{}
\;
echo
"Cleaning existing optimized images..."
find
"
${
IMAGES_OPTIMIZED_FOLDER
}
"
-type
f
-name
"*.png"
-exec
rm
{}
\;
IMAGES
=
"
$(
find
"
${
IMAGES_SELECTED_FOLDER
}
"
-type
f
-name
"*.png"
|
sort
)
"
while
read
-r
INPUT_FILE
;
do
...
...
This diff is collapsed.
Click to expand it.
scripts/04_build_images_board.sh
0 → 100755
+
53
−
0
View file @
9d310c99
#!/usr/bin/env bash
command
-v
jq
>
/dev/null 2>&1
||
{
echo
>
&2
"I require jq (json parser) but it's not installed. Aborting."
;
exit
1
;
}
CURRENT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
>
/dev/null 2>&1
&&
pwd
)
"
BASE_DIR
=
"
$(
dirname
"
${
CURRENT_DIR
}
"
)
"
IMAGES_CACHE_FOLDER
=
"
${
CURRENT_DIR
}
/cache"
IMAGES_OPTIMIZED_FOLDER
=
"
${
IMAGES_CACHE_FOLDER
}
/optimized"
OUTPUT_IMAGES_BOARD_FILE
=
"
${
IMAGES_CACHE_FOLDER
}
/images_board.html"
touch
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
"Cleaning empty/temp files..."
find
"
${
IMAGES_OPTIMIZED_FOLDER
}
"
-type
f
-name
"*.png"
-empty
-exec
rm
{}
\;
find
"
${
IMAGES_OPTIMIZED_FOLDER
}
"
-type
f
-name
"*.tmp*"
-exec
rm
{}
\;
find
"
${
IMAGES_OPTIMIZED_FOLDER
}
"
-type
d
-empty
-exec
rm
-rf
{}
\;
echo
"Building images board file..."
FILES
=
"
$(
find
"
${
IMAGES_OPTIMIZED_FOLDER
}
"
-type
f
-name
"*.png"
|
sed
"s|^
${
IMAGES_OPTIMIZED_FOLDER
}
/||g"
|
sort
)
"
KEYWORDS
=
"
$(
echo
"
${
FILES
}
"
|
cut
-d
'/'
-f1
|
sort
|
uniq
)
"
echo
"<!DOCTYPE html>"
>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
"<html lang=
\"
en
\"
>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" <head>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" <style>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" table { border-collapse: collapse; border: solid 2px black; width: 100%; }"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" tr { }"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" td { border: solid 1px black; }"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" span { font-weight: bold; }"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" img { border: solid 1px grey; }"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" </style>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" </head>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" <body>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" <table>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
while
read
-r
KEYWORD
;
do
if
[[
-n
"
${
KEYWORD
}
"
]]
;
then
echo
" <tr>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" <td><span>
${
KEYWORD
}
</span></td>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
FILES_KEYWORD
=
"
$(
echo
"
${
FILES
}
"
|
grep
-e
"^
${
KEYWORD
}
/"
)
"
echo
" <td>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
while
read
-r
FILE
;
do
echo
" <img src=
\"
optimized/
${
FILE
}
\"
>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
done
< <
(
echo
"
${
FILES_KEYWORD
}
"
)
echo
" </td>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" </tr>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
fi
done
< <
(
echo
"
${
KEYWORDS
}
"
)
echo
" </table>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
" </body>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
"</html>"
>>
"
${
OUTPUT_IMAGES_BOARD_FILE
}
"
echo
"done."
This diff is collapsed.
Click to expand it.
scripts/0
4
_build_assets_list.sh
→
scripts/0
5
_build_assets_list.sh
+
0
−
0
View file @
9d310c99
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment