Skip to content

Commit

Permalink
Merge pull request #13 from dalikewara/v4
Browse files Browse the repository at this point in the history
update some scripts
  • Loading branch information
dalikewara authored Mar 17, 2024
2 parents 1621362 + e191e40 commit 7b771c6
Show file tree
Hide file tree
Showing 37 changed files with 22 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

## 2024

- **v4.4.0 - v4.4.2** (2024-03-17)
- **v4.4.0 - v4.4.4** (2024-03-17)
- Fix `main_v4.sh` permission
- Fix create `main_v4_latest.sh` permission
- Fix `_base_structure` permission
- Now using [ayapingping-sh](https://github.com/dalikewara/ayapingping-sh) main shell script
- Add command `exportFeature`, `exportDomain` and `exportCommon`
- Rename param `requirements` in the `features/yourFeature/dependency.json` file to `externals`
Expand Down
Empty file modified _main/_base_structure/.dockerignore
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/.env.example
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/.gitignore
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/Dockerfile
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/LICENSE
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/Makefile
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/README.md
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/README.md
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/__init__.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/env.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/flask.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/mysql_connector.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/time_now.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/common/validate_username.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/docker-compose.yml
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/domain/README.md
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/domain/__init__.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/domain/example.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/features/example/README.md
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified _main/_base_structure/features/example/dependency.json
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified _main/_base_structure/features/example/utility/__init__.py
100644 → 100755
Empty file.
Empty file.
Empty file modified _main/_base_structure/infra/README.md
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/main.py
100644 → 100755
Empty file.
Empty file modified _main/_base_structure/requirements.txt
100644 → 100755
Empty file.
8 changes: 7 additions & 1 deletion _main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

name = "AyaPingPing (Py)"
version = "v4.4.2"
version = "v4.4.4"
language = "Python"
path_separator = os.path.sep

Expand All @@ -28,6 +28,12 @@ def main():
os.chmod(os.path.join(runtime_dir, 'main_v4.sh'), 0o777)
os.chmod(os.path.join(runtime_dir, 'main_v4_latest.sh'), 0o777)

for root, dirs, files in os.walk(os.path.join(runtime_dir, '_base_structure')):
for dir_name in dirs:
os.chmod(os.path.join(root, dir_name), 0o777)
for file_name in files:
os.chmod(os.path.join(root, file_name), 0o777)

cmd = [os.path.join(runtime_dir, 'main_v4.sh'), version, language, command, value, source_prefix, source]
subprocess.run(cmd, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin)

Expand Down
18 changes: 12 additions & 6 deletions _main/main_v4_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ get_raw_json_from_file_for_external() {
exit 1
fi

cat "$1" | tr -d '\n' | tr -s '[:blank:]' ' ' | sed 's/* //g'
cat "$1" | tr -d '
' | tr -s '[:blank:]' ' ' | sed 's/* //g'
}

get_json_value_by_key() {
Expand All @@ -483,7 +484,7 @@ get_json_value_by_key() {
exit 1
fi

get_clean_json_value "$(echo "$1" | tr -d '[:space:]' | sed -n -e "s/.*\"$2\":\[\([^]]*\)\].*/\1/p")"
get_clean_json_value "$(echo "$1" | tr -d '[:space:]' | sed -n -e "s/.*\"$2\":\[\([^]]*\)\].*//p")"
}

get_json_value_by_key_for_external() {
Expand All @@ -492,7 +493,7 @@ get_json_value_by_key_for_external() {
exit 1
fi

get_clean_json_value_for_external "$(echo "$1" | sed -n 's/.*"'$2'":\(\[ *\| \[ *\| *\[\)\([^]]*\).*/\2/p')"
get_clean_json_value_for_external "$(echo "$1" | sed -n 's/.*"'$2'":\(\[ *\| \[ *\| *\[\)\([^]]*\).*//p')"
}

get_clean_json_value() {
Expand All @@ -501,7 +502,9 @@ get_clean_json_value() {
exit 1
fi

get_clean_string_from_space "$1" | tr -d '"' | tr ',' '\n' | tr -s '\n' ','
get_clean_string_from_space "$1" | tr -d '"' | tr ',' '
' | tr -s '
' ','
}

get_clean_json_value_for_external() {
Expand All @@ -510,7 +513,9 @@ get_clean_json_value_for_external() {
exit 1
fi

echo "$1" | tr -d '"' | tr ',' '\n' | tr -s '\n' ',' | tr -d '[:blank:]' | sed -e 's/, */,/g' -e 's/, *$/ /'
echo "$1" | tr -d '"' | tr ',' '
' | tr -s '
' ',' | tr -d '[:blank:]' | sed -e 's/, */,/g' -e 's/, *$/ /'
}

get_clean_string_from_space() {
Expand Down Expand Up @@ -685,7 +690,8 @@ remove_contents_from_directory() {
return 1
fi

echo "$2" | tr ',' '\n' | while IFS= read -r _3_item; do
echo "$2" | tr ',' '
' | while IFS= read -r _3_item; do
_3_item=$(echo "$_3_item" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

find "$1" -name "$_3_item" -exec rm -rf {} \;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='ayapingping-py',
version='4.4.2',
version='4.4.4',
python_requires='>=3.10.12',
author='Dali Kewara',
author_email='[email protected]',
Expand Down

0 comments on commit 7b771c6

Please sign in to comment.