Skip to content

Commit cb5c06f

Browse files
author
Carlos J. Ramirez
committed
GS BE Scripts Ver. 1.0.8
Add: "npm_remove_ignored.sh" to remove files in ".gitignore" or ".npmignore". Change "npm_publish.sh" to implement "npm_remove_ignored.sh".
1 parent 4f23e49 commit cb5c06f

File tree

9 files changed

+105
-8
lines changed

9 files changed

+105
-8
lines changed

.gitignore

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,19 @@ chalicelib/src
5757
gunicorn.access.log
5858
gunicorn.error.log
5959
logs/app_general.log
60+
61+
# Other files
6062
scripts/aws_big_lambda/lambda-config-*.json
6163
scripts/aws_big_lambda/template.yml
6264
scripts/aws_big_lambda/samconfig.toml
63-
response.json
64-
scripts/dns/config/zones/*
65+
scripts/dns/config/zones
6566
scripts/dns/config/named-to-add.conf
6667
scripts/secure_local_server/nginx.conf
6768
scripts/secure_local_server/nginx.conf.tmp
6869
scripts/vps/docker-compose.yml
6970
scripts/vps/docker-compose.tmp.yml
7071
scripts/dns/Dockerfile
72+
73+
response.json
74+
75+
tmp

.npmignore

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,19 @@ chalicelib/src
5757
gunicorn.access.log
5858
gunicorn.error.log
5959
logs/app_general.log
60+
61+
# Other files
6062
scripts/aws_big_lambda/lambda-config-*.json
6163
scripts/aws_big_lambda/template.yml
6264
scripts/aws_big_lambda/samconfig.toml
63-
response.json
64-
scripts/dns/config/zones/*
65+
scripts/dns/config/zones
6566
scripts/dns/config/named-to-add.conf
6667
scripts/secure_local_server/nginx.conf
6768
scripts/secure_local_server/nginx.conf.tmp
6869
scripts/vps/docker-compose.yml
6970
scripts/vps/docker-compose.tmp.yml
7071
scripts/dns/Dockerfile
72+
73+
response.json
74+
75+
tmp

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
1717
### Breaks
1818

1919

20+
## 1.0.8 (2024-04-26)
21+
---
22+
23+
### New
24+
Add "npm_remove_ignored.sh" to remove files in ".gitignore" or ".npmignore".
25+
26+
### Changes
27+
Change "npm_publish.sh" to implement "npm_remove_ignored.sh".
28+
29+
2030
## 1.0.7 (2024-04-20)
2131
---
2232

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "genericsuite-be-scripts",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "GenericSuite Scripts (backend version)",
55
"author": "Carlos J. Ramirez",
66
"license": "ISC",

scripts/aws/run_aws.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [ ! -d "./${APP_DIR}" ]; then
3535
exit 1
3636
fi
3737

38-
# Default App entry point coode file
38+
# Default App entry point code file
3939
if [ "${APP_MAIN_FILE}" = "" ]; then
4040
# https://aws.github.io/chalice/topics/packaging.html
4141
APP_MAIN_FILE='app'

scripts/aws_big_lambda/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
venv
2+
.env
3+
4+
lambda-config-*.json
5+
template.yml
6+
samconfig.toml

scripts/npm_publish.sh

+16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#
1111
# 2024-03-16 | CR
1212
#
13+
14+
show_date_time() {
15+
if [ "${APP_TZ}" = "" ]; then
16+
APP_TZ='America/New_York'
17+
fi
18+
TZ="${APP_TZ}" date
19+
}
20+
1321
REPO_BASEDIR="`pwd`"
1422
cd "`dirname "$0"`" ;
1523
SCRIPTS_DIR="`pwd`" ;
@@ -36,6 +44,13 @@ then
3644
exit 1
3745
fi
3846

47+
bash ${SCRIPTS_DIR}/npm_remove_ignored.sh .gitignore
48+
# if ! bash ${SCRIPTS_DIR}/npm_remove_ignored.sh .gitignore
49+
# then
50+
# echo "ERROR running: sh scripts/npm_remove_ignored.sh .gitignore"
51+
# exit 1
52+
# fi
53+
3954
if [ "${ACTION}" = "publish" ]; then
4055
echo ""
4156
echo "Are you sure you want to publish ${PACKAGE_NAME}:${PACKAGE_VERSION} (y/n)?"
@@ -47,3 +62,4 @@ fi
4762

4863
echo ""
4964
echo "Done with ${ACTION} !"
65+
show_date_time

scripts/npm_remove_ignored.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# File: scripts/npm_remove_ignored.sh
3+
# Run:
4+
# sh scripts/npm_remove_ignored.sh .npmignore
5+
# sh scripts/npm_remove_ignored.sh .gitignore
6+
# 2024-04-21 | CR
7+
#
8+
9+
REPO_BASEDIR="`pwd`"
10+
cd "`dirname "$0"`" ;
11+
SCRIPTS_DIR="`pwd`" ;
12+
cd "${REPO_BASEDIR}"
13+
TMP_SCRIPT="/tmp/gs_remove_ignored.sh"
14+
15+
echo "Removing ignored files from: $1"
16+
17+
if [ "$1" = "" ]; then
18+
echo "Usage: $0 <file>"
19+
exit 1
20+
fi
21+
if [ ! -f "$1" ]; then
22+
echo "ERROR: File $1 not found"
23+
exit 1
24+
fi
25+
26+
27+
cat > "${TMP_SCRIPT}" <<END \
28+
29+
#!/bin/bash
30+
ask_yes_or_no() {
31+
read choice
32+
while [[ ! \$choice =~ ^[YyNn]$ ]]; do
33+
echo "Please enter Y or N"
34+
read choice
35+
done
36+
}
37+
END
38+
39+
while IFS= read -r line || [ -n "$line" ]; do
40+
if [ ! -z "$line" ]; then
41+
if ls "$line" 2>/dev/null; then
42+
echo "echo \"\"" >> ${TMP_SCRIPT}
43+
echo "echo \"Removing $line\"" >> ${TMP_SCRIPT}
44+
echo "echo \"Are you sure? (Y/N)\"" >> ${TMP_SCRIPT}
45+
echo "ask_yes_or_no" >> ${TMP_SCRIPT}
46+
echo "if [[ \$choice =~ ^[Yy]$ ]]; then" >> ${TMP_SCRIPT}
47+
echo " rm -rf "$line" 2>/dev/null" >> ${TMP_SCRIPT}
48+
echo "fi" >> ${TMP_SCRIPT}
49+
else
50+
echo "Ignoring $line"
51+
fi
52+
fi
53+
done < "$1"
54+
55+
bash ${TMP_SCRIPT}

0 commit comments

Comments
 (0)