forked from AdrianDC/advanced_development_shell_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid_uploads_basketbuild.rc
118 lines (103 loc) · 3.21 KB
/
android_uploads_basketbuild.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
#
# Copyright 2015-2017 Adrian DC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# === Uploads Credentials for BasketBuild ===
function __shtools_credentials_basketbuild()
{
# Usage: __shtools_credentials_basketbuild (Credentials for BasketBuild server)
# BasketBuild Upload Credentials
export FTPUploadUserUrl='basketbuild.com';
export FTPUploadUserName='username.basketbuild.com';
export FTPUploadPassword=;
export FTPUploadPath=;
# Create .bash_android.uploadftp.basketbuild.rc with the exports to override the credentials
source "${ANDROID_DEVELOPMENT_SHELL_TOOLS_WORKSPACE}/.bash_android.uploadftp.basketbuild.rc";
# Check missing credentials
[ ! "${FTPUploadUserName}" = 'username.basketbuild.com' ];
}
# === File Uploader BasketBuild ===
function uploadbasketbuild()
{
# Usage
if [ -z "${1}" ]; then
echo '';
echo ' Usage: uploadbasketbuild <file_path> [target_folder] (File to BasketBuild server uploader)';
echo '';
return;
fi;
# BasketBuild Uploads Credentials
if ! __shtools_credentials_basketbuild; then
>&2 echo '';
>&2 echo ' uploadbasketbuild: Open android_uploads_basketbuild.rc to see how to set your logins';
>&2 echo '';
return;
fi;
# Upload file to target with FTP
uploadftp "${1}" "${2}" 'basketbuild';
}
# === File Downloader BasketBuild ===
function downloadbasketbuild()
{
# Usage
if [ -z "${1}" ]; then
echo '';
echo ' Usage: downloadbasketbuild <remote_path> (Download from BasketBuild)';
echo '';
return;
fi;
# BasketBuild Uploads Credentials
if ! __shtools_credentials_basketbuild; then
>&2 echo '';
>&2 echo ' downloadbasketbuild: Open android_uploads_basketbuild.rc to see how to set your logins';
>&2 echo '';
return;
fi;
# Download file to target with FTP
downloadftp "${1}" 'basketbuild';
}
# === Private Uploader BasketBuild ===
function uploadprivatebasketbuild()
{
# Usage
if [ -z "${1}" ]; then
echo '';
echo ' Usage: uploadprivatebasketbuild <device_name> (Upload to private BasketBuild)';
echo '';
return;
fi;
# File upload to Private
uploadbasketbuild "${1}" '.private';
}
# === Folder Syncer BasketBuild ===
function syncbasketbuild()
{
# Usage
if [ -z "${1}" ] || [ -z "${3}" ]; then
echo '';
echo ' Usage: syncbasketbuild <local_path> <remote_path> <--download/--upload> (Folder with BasketBuild server syncer)';
echo '';
return;
fi;
# BasketBuild Uploads Credentials
if ! __shtools_credentials_basketbuild; then
>&2 echo '';
>&2 echo ' syncbasketbuild: Open android_uploads_basketbuild.rc to see how to set your logins';
>&2 echo '';
return;
fi;
# Upload file to target with FTP
syncftp "${1}" "${2}" "${3}" 'basketbuild';
}