-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable app download #69
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
10e1da6
Read from plist method
5f1c973
Read from plist to fill the fields on Settings opening
5ffc808
Fill the build picker on the main view
0d5b002
Add Download button
5bdc4b3
A bit of cleanup
0076905
Add download command
a8d5aca
Improve buildPicker state handling
JoeSSS 8c34d79
Update Changelog
JoeSSS 855dfe2
Apply PR recommendations
JoeSSS 15559da
Merge branch 'master' into enable_app_download
JoeSSS cdc7818
Merge branch 'master' into enable_app_download
JoeSSS d352392
Fix merge conflict
20d149c
Remore unnecessary file removal
0a738f3
Merge branch 'master' into enable_app_download
JoeSSS c3db732
Remove development team
JoeSSS 6629bd6
Restructure PlistOperations
JoeSSS a0d2ee8
Renaming
JoeSSS 7916bd3
Cleanup
BasThomas 0283259
Merge branch 'master' into enable_app_download
JoeSSS 895bb42
small bug fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ class TasksViewController: NSViewController { | |
var devices = [""] | ||
var timer: Timer! | ||
var pathToCalabashFolder = "" | ||
var linkInfoArray: ([String], [String]) = ([], []) | ||
var isDeviceListEmpty: Bool { | ||
return phoneComboBox.numberOfItems == 0 | ||
} | ||
|
@@ -128,7 +129,7 @@ class TasksViewController: NSViewController { | |
} | ||
|
||
@IBAction func clickDownloadButton(_ sender: Any) { | ||
// buildPicker.indexOfSelectedItem | ||
downloadAppFromLink(link: linkInfoArray.0[buildPicker.indexOfSelectedItem]) | ||
} | ||
|
||
@IBAction func buildPicker(_ sender: Any) { | ||
|
@@ -322,7 +323,7 @@ class TasksViewController: NSViewController { | |
|
||
func getValuesForBuildPicker() { | ||
buildPicker.removeAllItems() | ||
let linkInfoArray = plistOperations.readFromPlist(forKey: Constants.Strings.linkInfoKey) | ||
linkInfoArray = plistOperations.readFromPlist(forKey: Constants.Strings.linkInfoKey) | ||
buildPicker.addItems(withTitles: linkInfoArray.1) | ||
|
||
buildPicker.selectItem(at: applicationStateHandler.buildNumber) | ||
|
@@ -333,6 +334,19 @@ class TasksViewController: NSViewController { | |
} | ||
} | ||
|
||
func downloadAppFromLink(link: String) { | ||
if let launchPath = Constants.FilePaths.Bash.appDownload { | ||
let outputStream = CommandsCore.CommandTextOutputStream() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need the Also, can we please not add this to the VC? |
||
outputStream.textHandler = {text in | ||
DispatchQueue.main.async { | ||
self.textViewPrinter.printToTextView(text) | ||
} | ||
} | ||
let commands = CommandsCore.CommandExecutor() | ||
commands.executeCommand(at: launchPath, arguments: [link, pathToCalabashFolder], outputStream: outputStream) | ||
} | ||
} | ||
|
||
func quitIrbSession() { | ||
commands.executeCommand(at: Constants.FilePaths.Bash.quitIRBSession ?? "", arguments: []) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash --login | ||
export LANG=en_US.UTF-8 | ||
export LANGUAGE=en_US.UTF-8 | ||
export LC_ALL=en_US.UTF-8 | ||
|
||
filename=${1##*/} | ||
extension=${filename##*.} | ||
|
||
cd ${2} | ||
rm ${filename} | ||
curl -O ${1} | ||
if [ -e "$filename" ]; then | ||
echo "${filename} has been succesfully downloaded" | ||
else | ||
echo "Whoops, looks like your link is incorrect: '${1}'" | ||
fi | ||
|
||
if [ ${extension} == "zip" ]; then | ||
echo "Extracting APP from archieve" | ||
ditto -xk ${filename} . | ||
rm ${filename} | ||
echo "Extracted Succesfully" | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d make it a map 🗺