@furrymink/cli 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/app/create/gateway.sh +0 -1
- package/bin/app/create/mobile.wrapped.sh +106 -7
- package/bin/app/gateway.sh +1 -0
- package/bin/cli/gateway.sh +0 -3
- package/bin/cli/includes.sh +1 -8
- package/bin/files/copy.from-package-to-install.sh +9 -0
- package/bin/files/includes.sh +2 -0
- package/bin/forms/create-install-directory.sh +19 -0
- package/bin/forms/get.app-name.sh +27 -0
- package/bin/forms/get.author.sh +14 -0
- package/bin/forms/get.browser-port.sh +15 -0
- package/bin/forms/get.bugs-url.sh +22 -0
- package/bin/forms/get.default-package-id.sh +12 -0
- package/bin/forms/get.description.sh +15 -0
- package/bin/forms/get.directory.sh +27 -0
- package/bin/forms/get.homepage-url.sh +16 -0
- package/bin/forms/get.license.sh +14 -0
- package/bin/forms/get.package-id.sh +16 -0
- package/bin/forms/get.read-me-url.sh +23 -0
- package/bin/forms/get.repo-url.sh +16 -0
- package/bin/forms/get.type.sh +13 -0
- package/bin/forms/includes.sh +16 -0
- package/bin/forms/normalise.package-id.sh +13 -0
- package/bin/furrymink +4 -2
- package/bin/git/git.repo.change.sh +8 -0
- package/bin/git/git.repo.create.sh +8 -0
- package/bin/includes.sh +10 -0
- package/package.json +1 -1
- package/bin/cli/entry-point.sh +0 -5
|
@@ -7,9 +7,19 @@ __furrymink.install.android(){
|
|
|
7
7
|
npx cap add android
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
__furrymink.create-dotenv(){
|
|
11
|
+
local INSTALL_DIR="$1"
|
|
12
|
+
|
|
13
|
+
console.header "Updating local files"
|
|
14
|
+
console.log "Creating .env"
|
|
15
|
+
cat > "${INSTALL_DIR}/.env.development" << EOF
|
|
16
|
+
# AUTO GENERATED. DO NOT EDIT THIS FILE
|
|
17
|
+
PORT="${BROWSER_PORT}"
|
|
18
|
+
DEFAULT_PORT="${BROWSER_PORT_DEFAULT}"
|
|
19
|
+
EOF
|
|
20
|
+
}
|
|
12
21
|
|
|
22
|
+
__furrymink.install(){
|
|
13
23
|
local ARGS=("$@")
|
|
14
24
|
local _BASE_REPO_URL="furrymink"
|
|
15
25
|
|
|
@@ -28,10 +38,6 @@ furrymink.create.mobile.wrapped(){
|
|
|
28
38
|
local _DEV_BOWSER_PORT=$(get.broswer-port "3000")
|
|
29
39
|
local _TYPE=$(get.type)
|
|
30
40
|
|
|
31
|
-
local _PLATFORM=""
|
|
32
|
-
|
|
33
|
-
npx cap init "${_APP_NAME}" "${PACKAGE_ID}" --web-dir "www/dist"
|
|
34
|
-
|
|
35
41
|
local _TARGET_PLATFORM=$(
|
|
36
42
|
input.select "Select OS" \
|
|
37
43
|
--prefill "1" \
|
|
@@ -51,8 +57,101 @@ furrymink.create.mobile.wrapped(){
|
|
|
51
57
|
;;
|
|
52
58
|
*)
|
|
53
59
|
console.error "Invalid choice" >&2
|
|
54
|
-
install
|
|
60
|
+
__furrymink.install
|
|
55
61
|
;;
|
|
56
62
|
esac
|
|
57
63
|
|
|
64
|
+
__furrymink.update-files
|
|
65
|
+
__furrymink.update-gradle
|
|
66
|
+
__furrymink.update-template \
|
|
67
|
+
$_APP_NAME
|
|
68
|
+
__furrymink.update-npm \
|
|
69
|
+
$_APP_NAME \
|
|
70
|
+
$_VERSION \
|
|
71
|
+
$_TYPE \
|
|
72
|
+
$_REPO_URL \
|
|
73
|
+
$_BUGS_URL \
|
|
74
|
+
$_HOMEPAGE_URL \
|
|
75
|
+
$_LICENSE
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
npx cap sync
|
|
79
|
+
|
|
80
|
+
git.repo.change \
|
|
81
|
+
$_REPO_URL \
|
|
82
|
+
"main"
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
__furrymink.update-npm(){
|
|
89
|
+
# cd install fir
|
|
90
|
+
local APP_NAME="$1"
|
|
91
|
+
local VERSION="$2"
|
|
92
|
+
local TYPE="$3"
|
|
93
|
+
local REPO_URL="$4"
|
|
94
|
+
local BUGS_URL="$5"
|
|
95
|
+
local HOMEPAGE_URL="$6"
|
|
96
|
+
local LICENSE="$7"
|
|
97
|
+
|
|
98
|
+
npm pkg set name="${APP_NAME}"
|
|
99
|
+
npm pkg set type="${TYPE}"
|
|
100
|
+
npm pkg set main="index.mjs"
|
|
101
|
+
npm pkg set repository.url="${REPO_URL}"
|
|
102
|
+
npm pkg set bugs.url="${BUGS_URL}"
|
|
103
|
+
npm pkg set homepage="${HOMEPAGE_URL}"
|
|
104
|
+
npm pkg set scripts.build="./scripts/build.sh"
|
|
105
|
+
npm pkg set scripts.launch:web="./scripts/launch-web.sh"
|
|
106
|
+
npm pkg set scripts.launch:android="./scripts/launch-android.sh"
|
|
107
|
+
npm pkg set scripts.launch:ios="./scripts/launch-ios.sh"
|
|
108
|
+
npm pkg set scripts.git:push="./scripts/git-push.sh"
|
|
109
|
+
npm pkg set scripts.git:commit="./scripts/git-commit.sh"
|
|
110
|
+
npm pkg set scripts.open:studio:push="npx cap open android"
|
|
111
|
+
|
|
112
|
+
if [[ -z "${LICENSE//[[:space:]]/}" ]]; then
|
|
113
|
+
npm pkg delete license
|
|
114
|
+
else
|
|
115
|
+
npm pkg set license="${LICENSE}"
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
__furrymink.update-files(){
|
|
121
|
+
echo "__furrymink.update-files"
|
|
122
|
+
# cd install fir
|
|
123
|
+
# RENAME DOTENV > .env
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
__furrymink.update-template(){
|
|
127
|
+
echo "__furrymink.update-template"
|
|
128
|
+
local APP_NAME="$1"
|
|
129
|
+
# cd install fir
|
|
130
|
+
# sed -i "s/{{APP_NAME}}/$APP_NAME/" "${INSTALL_DIR}/www/src/index.html"
|
|
131
|
+
# sed -i "s/{{VERSION}}/$VERSION/" "${INSTALL_DIR}/www/src/index.html"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
__furrymink.update-gradle(){
|
|
135
|
+
echo "__furrymink.update-gradle"
|
|
136
|
+
# cd install fir
|
|
137
|
+
|
|
138
|
+
# sed -i 's#^distributionUrl=.*#distributionUrl=https\\://services.gradle.org/distributions/gradle-9.1.0-bin.zip#' "${INSTALL_DIR}/android/gradle/wrapper/gradle-wrapper.properties"
|
|
139
|
+
# sed -i "s/proguard-android\.txt/proguard-android-optimize.txt/g" "${INSTALL_DIR}/android/app/build.gradle"
|
|
140
|
+
# sed -i "s/com.android.tools.build:gradle:8.13.0/com.android.tools.build:gradle:9.0.1/g" "${INSTALL_DIR}/android/build.gradle"
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
app.create.mobile.wrapped(){
|
|
145
|
+
echo "6.1"
|
|
146
|
+
console.header "Create Wrapped Mobile App"
|
|
147
|
+
|
|
148
|
+
cd "${INSTALL_DIR}"
|
|
149
|
+
|
|
150
|
+
npm exec --yes --package=/home/hushmonkey/furrymink/gitlab/furrymink/furry-installers/boilerplates/capacitorjs -- create-plugin
|
|
151
|
+
|
|
152
|
+
#npm init @furry-boilerplates/capacitorjs
|
|
153
|
+
|
|
154
|
+
__furrymink.install
|
|
155
|
+
|
|
156
|
+
|
|
58
157
|
}
|
package/bin/app/gateway.sh
CHANGED
package/bin/cli/gateway.sh
CHANGED
|
@@ -6,11 +6,9 @@ cli.gateway(){
|
|
|
6
6
|
|
|
7
7
|
case $COMMAND in
|
|
8
8
|
git)
|
|
9
|
-
console.echo "GIT"
|
|
10
9
|
git.gateway "${ARGS[@]}";;
|
|
11
10
|
# include.scripts "git/entry.sh" "$@";;
|
|
12
11
|
npm)
|
|
13
|
-
console.echo "NPM"
|
|
14
12
|
npm.gateway "${ARGS[@]}";;
|
|
15
13
|
# include.scripts "npm/entry.sh" "$@";;
|
|
16
14
|
create)
|
|
@@ -18,7 +16,6 @@ cli.gateway(){
|
|
|
18
16
|
# include.scripts "plugin/entry.sh" "$@";;
|
|
19
17
|
*)
|
|
20
18
|
console.error "Unknown command '${COMMAND}'";;
|
|
21
|
-
|
|
22
19
|
esac
|
|
23
20
|
|
|
24
21
|
}
|
package/bin/cli/includes.sh
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### USER INPUT: CREATE INSTALL DIRECTORY
|
|
4
|
+
############################
|
|
5
|
+
create.install-directory(){
|
|
6
|
+
local DEFAULT=$1
|
|
7
|
+
local USER_DIR=$2
|
|
8
|
+
local APP_DIR=$(
|
|
9
|
+
input.text "Install directory" \
|
|
10
|
+
--prefill "${DEFAULT}" \
|
|
11
|
+
--required
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
local INSTALL_DIR="${USER_DIR}/${APP_DIR}"
|
|
15
|
+
|
|
16
|
+
mkdir -p "${INSTALL_DIR}"
|
|
17
|
+
|
|
18
|
+
echo "${INSTALL_DIR}"
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### USER INPUT: APP NAME
|
|
5
|
+
############################
|
|
6
|
+
get.app-name(){
|
|
7
|
+
local DEFAULT=$1
|
|
8
|
+
local ANSWER=$(
|
|
9
|
+
input.text "App name" \
|
|
10
|
+
--prefill "${DEFAULT}" \
|
|
11
|
+
--required
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
if [[ $(is.scoped $ANSWER) == "true" ]]; then
|
|
15
|
+
console.error "App name cannot be scoped"
|
|
16
|
+
get.app-name
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
if [[ $ANSWER == *"/"* ]]; then
|
|
21
|
+
console.error "App name cannot contain slashes"
|
|
22
|
+
get.app-name
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
echo $ANSWER
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### USER INPUT: BROWSER PORT
|
|
5
|
+
############################
|
|
6
|
+
get.broswer-port(){
|
|
7
|
+
local DEFAULT=$1
|
|
8
|
+
local ANSWER=$(
|
|
9
|
+
input.text "Browser port" \
|
|
10
|
+
--prefill "${DEFAULT}" \
|
|
11
|
+
--required
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
echo $ANSWER
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### USER INPUT: Bugs URL
|
|
4
|
+
############################
|
|
5
|
+
get.bugs-url(){
|
|
6
|
+
local BASE_URL=$1
|
|
7
|
+
local BUGS_URL="https://gitlab.com/${BASE_URL}/BUGS.md"
|
|
8
|
+
|
|
9
|
+
local ANSWER=$(
|
|
10
|
+
input.text "BUGS URL" \
|
|
11
|
+
--prefill "${BUGS_URL}" \
|
|
12
|
+
--required
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
if [[ $ANSWER == *"@"* ]]; then
|
|
16
|
+
console.error "Invalid Bugs URL"
|
|
17
|
+
get.bugs-url
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
echo "${ANSWER}"
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### DEFAULT PACKAGE ID
|
|
4
|
+
############################
|
|
5
|
+
default-package-id(){
|
|
6
|
+
local BASE_URL="$1"
|
|
7
|
+
local APP_NAME="$2"
|
|
8
|
+
|
|
9
|
+
local PACKAGE_ID="com.${BASE_URL}.${APP_NAME}"
|
|
10
|
+
|
|
11
|
+
echo $(normalise.package-id $PACKAGE_ID)
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### USER INPUT: DESCRIPTION
|
|
5
|
+
############################
|
|
6
|
+
get.description(){
|
|
7
|
+
local DEFAULT=$1
|
|
8
|
+
local ANSWER=$(
|
|
9
|
+
input.text "Description" \
|
|
10
|
+
--prefill "${DEFAULT}" \
|
|
11
|
+
--required
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
echo $ANSWER
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### USER INPUT: APP NAME
|
|
5
|
+
############################
|
|
6
|
+
get.directory(){
|
|
7
|
+
local DEFAULT=$1
|
|
8
|
+
local ANSWER=$(
|
|
9
|
+
input.text "Directory" \
|
|
10
|
+
--prefill "${DEFAULT}" \
|
|
11
|
+
--required
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
if [[ $(is.scoped $ANSWER) == "true" ]]; then
|
|
15
|
+
console.error "App name cannot be scoped"
|
|
16
|
+
get.app-name
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
if [[ $ANSWER == *"/"* ]]; then
|
|
21
|
+
console.error "App name cannot contain slashes"
|
|
22
|
+
get.app-name
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
echo $ANSWER
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### USER INPUT: Homepage URL
|
|
4
|
+
############################
|
|
5
|
+
get.home-page-url(){
|
|
6
|
+
local BASE_URL=$1
|
|
7
|
+
local HOMEPAGE_URL="https://gitlab.com/${BASE_URL}"
|
|
8
|
+
|
|
9
|
+
local ANSWER=$(
|
|
10
|
+
input.text "Homepage URL" \
|
|
11
|
+
--prefill "${HOMEPAGE_URL}" \
|
|
12
|
+
--required
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
echo "${ANSWER}"
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### USER INPUT: PACKAGE ID
|
|
4
|
+
############################
|
|
5
|
+
get.package-id(){
|
|
6
|
+
local BASE_REPO_URL=$1
|
|
7
|
+
local APP_NAME=$2
|
|
8
|
+
local DEFAULT=$(default-package-id "$BASE_REPO_URL" "$APP_NAME")
|
|
9
|
+
|
|
10
|
+
local ANSWER=$(
|
|
11
|
+
input.text "Package ID" \
|
|
12
|
+
--prefill "${DEFAULT}" \
|
|
13
|
+
--required
|
|
14
|
+
)
|
|
15
|
+
echo $ANSWER
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### USER INPUT: README Url
|
|
5
|
+
############################
|
|
6
|
+
get.read-me-url(){
|
|
7
|
+
local BASE_URL=$1
|
|
8
|
+
local READ_ME_URL="https://gitlab.com/${BASE_URL}/README.md"
|
|
9
|
+
|
|
10
|
+
local ANSWER=$(
|
|
11
|
+
input.text "README URL" \
|
|
12
|
+
--prefill "${READ_ME_URL}" \
|
|
13
|
+
--required
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
if [[ $ANSWER == *"@"* ]]; then
|
|
17
|
+
console.error "Invalid Readme URL"
|
|
18
|
+
get.read-me-url
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo "$ANSWER"
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
############################
|
|
3
|
+
### USER INPUT: REPO URL
|
|
4
|
+
############################
|
|
5
|
+
get.repo-url(){
|
|
6
|
+
local BASE_URL=$1
|
|
7
|
+
local REPO_URL="git@gitlab.com:${BASE_URL}.git"
|
|
8
|
+
|
|
9
|
+
local ANSWER=$(
|
|
10
|
+
input.text "Repo URL" \
|
|
11
|
+
--prefill "${REPO_URL}" \
|
|
12
|
+
--required
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
echo "${ANSWER}"
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
include.scripts \
|
|
2
|
+
"forms/create-install-directory.sh" \
|
|
3
|
+
"forms/get.app-name.sh" \
|
|
4
|
+
"forms/get.author.sh" \
|
|
5
|
+
"forms/get.browser-port.sh" \
|
|
6
|
+
"forms/get.bugs-url.sh" \
|
|
7
|
+
"forms/get.default-package-id.sh" \
|
|
8
|
+
"forms/get.description.sh" \
|
|
9
|
+
"forms/get.directory.sh" \
|
|
10
|
+
"forms/get.homepage-url.sh" \
|
|
11
|
+
"forms/get.license.sh" \
|
|
12
|
+
"forms/get.package-id.sh" \
|
|
13
|
+
"forms/get.read-me-url.sh" \
|
|
14
|
+
"forms/get.repo-url.sh" \
|
|
15
|
+
"forms/get.type.sh" \
|
|
16
|
+
"forms/normalise.package-id.sh"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
############################
|
|
4
|
+
### NORMALISE STRING
|
|
5
|
+
############################
|
|
6
|
+
normalise.package-id(){
|
|
7
|
+
local PACKAGE_ID=$1
|
|
8
|
+
PACKAGE_ID="${PACKAGE_ID//@/}"
|
|
9
|
+
PACKAGE_ID="${PACKAGE_ID//\//.}"
|
|
10
|
+
PACKAGE_ID="${PACKAGE_ID//\-/}"
|
|
11
|
+
|
|
12
|
+
echo "$PACKAGE_ID"
|
|
13
|
+
}
|
package/bin/furrymink
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
3
3
|
CLI_PATH="$(realpath "$BIN_PATH/..")"
|
|
4
4
|
MODULES_PATH="${BIN_PATH}/modules"
|
|
5
|
+
INSTALL_DIR="$PWD"
|
|
6
|
+
PACKAGE_PATH="$(realpath "$BIN_PATH/..")"
|
|
5
7
|
|
|
6
8
|
include.scripts(){
|
|
7
9
|
local SCRIPTS=("$@")
|
|
@@ -12,6 +14,6 @@ include.scripts(){
|
|
|
12
14
|
done
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
include.scripts "
|
|
17
|
+
include.scripts "includes.sh"
|
|
16
18
|
|
|
17
|
-
cli.
|
|
19
|
+
cli.gateway "$@"
|
package/bin/includes.sh
ADDED
package/package.json
CHANGED