@getik-public/cli 1.5.2 → 1.5.4
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/upload-to-getik-cloud.js +11 -8
- package/src/web-build.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
### v1.5.4
|
|
2
|
+
- Remove option to add entire folder(`--folder`), read file extension to be sent in request as `&type=extension`, make script more dynamic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### v1.5.3
|
|
6
|
+
- Added option to upload a folder to cloud, script will zip entire folder then upload it
|
|
7
|
+
- Remove actual host and added it as a required input parameter as path to upload
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
### v1.5.2
|
|
2
11
|
- Added new parameters to include different types of build for the same environment: `--includeDemo` and `--includeFallback`
|
|
3
12
|
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ Example: `getik-cli web-build -e getik`
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
## <a name="upload-to-getik-cloud" href="#upload-to-getik-cloud">`upload-to-getik-cloud`</a>
|
|
49
|
-
### Usage: `getik-cli upload-to-getik-cloud ./path/to/my-file.apk`
|
|
49
|
+
### Usage: `getik-cli upload-to-getik-cloud ./path/to/my-file.apk --host awesome.host.net`
|
|
50
50
|
Use this command to upload apk files to getik cloud. If successful, in command line you will find a direct link to fresh uploaded file alongside a link to the full list.
|
|
51
51
|
Run this command from the root of the project, as it tries to look for project name in `package.json` file. Project name will be used as file name.
|
|
52
52
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import fs from 'fs';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
const upload = (pathToFile) => {
|
|
8
|
+
const upload = (pathToFile, host) => {
|
|
9
9
|
let projectName = '';
|
|
10
10
|
try {
|
|
11
11
|
const packageJsonBuffer = fs.readFileSync(path.join(process.cwd(), 'package.json'));
|
|
@@ -35,8 +35,10 @@ const upload = (pathToFile) => {
|
|
|
35
35
|
}
|
|
36
36
|
const splitFileName = normalizedPathToFile.split(path.sep);
|
|
37
37
|
const fileNameWithExtension = splitFileName[splitFileName.length - 1];
|
|
38
|
-
const
|
|
39
|
-
const
|
|
38
|
+
const fileNameSplit = fileNameWithExtension.split('.');
|
|
39
|
+
const fileNameOnly = fileNameSplit[0];
|
|
40
|
+
const fileExtension = fileNameSplit[fileNameSplit.length - 1];
|
|
41
|
+
const command = `curl -Ss -F "file=@${normalizedPathToFile}" "https://${host}/upload-apk/?name=${projectName}-${fileNameOnly}&appVersion=${issue}&commit=${commit}&type=${fileExtension}"`;
|
|
40
42
|
|
|
41
43
|
console.log('COMMAND: ', '\x1b[96m', command, '\x1b[0m');
|
|
42
44
|
const ls = spawn(command, [], {shell: true, env: { ...process.env, FORCE_COLOR: true }, cwd: ''});
|
|
@@ -46,8 +48,8 @@ const upload = (pathToFile) => {
|
|
|
46
48
|
try {
|
|
47
49
|
const parsedResponse = JSON.parse(data.toString());
|
|
48
50
|
if (parsedResponse && parsedResponse.status === 'success' && parsedResponse.fileName) {
|
|
49
|
-
console.log(chalk.green(`Link to uploaded file: https
|
|
50
|
-
console.log(chalk.green(
|
|
51
|
+
console.log(chalk.green(`Link to uploaded file: https://${host}/vbox/apk/${parsedResponse.fileName}`));
|
|
52
|
+
console.log(chalk.green(`Link to list: https://${host}/vbox/apk/?C=M;O=D`));
|
|
51
53
|
}
|
|
52
54
|
} catch (e) {
|
|
53
55
|
// console.log(e);
|
|
@@ -71,8 +73,9 @@ const upload = (pathToFile) => {
|
|
|
71
73
|
export const uploadToGetikCloud = () => {
|
|
72
74
|
program
|
|
73
75
|
.command('upload-to-getik-cloud <source>')
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
.requiredOption('--host <type>', 'Provide host, ex: my.host.net')
|
|
77
|
+
.action((pathToBuild, options) => {
|
|
78
|
+
console.log('INPUT OPTIONS: ', pathToBuild, options);
|
|
79
|
+
upload(pathToBuild, options.host);
|
|
77
80
|
});
|
|
78
81
|
};
|