Skip to content

Commit

Permalink
Merge pull request #4 from Marcus-Hines/create-release
Browse files Browse the repository at this point in the history
v2 new release
  • Loading branch information
marcus-chris-hines authored May 2, 2022
2 parents 2d710c3 + 4930120 commit 35194dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
13 changes: 5 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20044,18 +20044,15 @@ class PrivateKubectl extends kubectl_1.Kubectl {
}
extractFiles(strToParse) {
const result = [];
if (strToParse == null || strToParse.length == 0) {
return result;
}
// handle long hand
const start = strToParse.indexOf("-f") + 3;
var start = strToParse.indexOf("-f");
+3;
if (start == -1) {
return result;
}
const temp = strToParse.substring(start);
const end = temp.indexOf(" -");
var temp = strToParse.substring(start);
var end = temp.indexOf(" -");
// End could be case where the -f flag was last, or -f is followed by some additonal flag and it's arguments
return temp.substring(3, end == -1 ? temp.length : end).trim().split("\\s");
return temp.substring(3, end == -1 ? temp.length : end).trim().split(/[\s]+/);
}
}
exports.PrivateKubectl = PrivateKubectl;
Expand Down
19 changes: 9 additions & 10 deletions src/types/privatekubectl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ export class PrivateKubectl extends Kubectl{

public extractFiles(strToParse: string) {
const result = [];
if (strToParse == null || strToParse.length == 0){
return result;
}
// handle long hand
const start = strToParse.indexOf("-f" ) + 3;
if (start == -1){
return result;
var start = strToParse.indexOf("-f" ); + 3

if(start == -1){
return result;
}
const temp = strToParse.substring(start);
const end = temp.indexOf(" -");

var temp = strToParse.substring(start);
var end = temp.indexOf(" -");

// End could be case where the -f flag was last, or -f is followed by some additonal flag and it's arguments
return temp.substring(3, end == -1 ? temp.length : end).trim().split("\\s");
return temp.substring(3, end == -1 ? temp.length : end).trim().split(/[\s]+/);
}
}

0 comments on commit 35194dd

Please sign in to comment.