-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbdb78a
commit c6bf022
Showing
7 changed files
with
37 additions
and
25 deletions.
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 |
---|---|---|
@@ -1,38 +1,32 @@ | ||
console.log('first js.js'); | ||
//var cmd = require('node-command-line'),Promise = require('bluebird'); | ||
var cmd=require('node-cmd'); | ||
const { exec } = require('child_process'); | ||
const { exec } = require('child_process').exec; | ||
|
||
if(localStorage.getItem("megatron")){ | ||
if(localStorage.getItem("path")){ | ||
window.location="index.html"; | ||
} | ||
document.querySelector('#btnfirstSubmit').addEventListener('click', navigate); | ||
document.querySelector('#btnadbinfo').addEventListener('click', determineOS); | ||
function navigate(){ | ||
if(document.getElementById('android_sdk_path').value!=''){ | ||
localStorage.setItem('megatron',document.getElementById('android_sdk_path').value) | ||
localStorage.setItem('path',document.getElementById('android_sdk_path').value) | ||
window.location='index.html'; | ||
}else{ | ||
alert("You cant proceed without entering this") | ||
} | ||
} | ||
function displayadbinfo(command) { | ||
exec(command, (error, stdout, stderr) => { | ||
if (error) { | ||
console.log(`exec error: ${error}`); | ||
alert(error); | ||
}else{ | ||
console.log(`stdout: "The adb path is" ${stdout}`); | ||
alert(stdout) | ||
} | ||
}); | ||
|
||
} | ||
function determineOS() { | ||
const {app} = require('electron'); | ||
if (process.platform === "win32") { | ||
alert("We detected you are using windows. Please type 'adb' in your command prompt and copy the value from 'Installed at'") | ||
} | ||
else { | ||
displayadbinfo("which adb") | ||
alert("we are still working on fetching this, please add your ANDROID_HOME path or WHICH ADB path with upto adb") | ||
|
||
} | ||
} | ||
} | ||
function deletelocalstorage() { | ||
window.localStorage.clear(); | ||
} |
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
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