2016-01-27 02:36:30 +00:00
|
|
|
import os from 'os';
|
2016-03-11 04:40:08 +00:00
|
|
|
import axios from 'axios';
|
2016-01-27 02:36:30 +00:00
|
|
|
|
|
|
|
function isOSX() {
|
|
|
|
return os.platform() === 'darwin';
|
|
|
|
}
|
|
|
|
|
2016-01-28 15:02:42 +00:00
|
|
|
function isWindows() {
|
2016-03-10 04:46:09 +00:00
|
|
|
return os.platform() === 'win32';
|
2016-01-28 15:02:42 +00:00
|
|
|
}
|
2016-01-29 03:37:54 +00:00
|
|
|
|
2016-03-11 04:40:08 +00:00
|
|
|
function downloadFile(fileUrl) {
|
|
|
|
return axios.get(
|
|
|
|
fileUrl, {
|
|
|
|
responseType: 'arraybuffer'
|
|
|
|
})
|
|
|
|
.then(function(response) {
|
|
|
|
return response.data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-01-27 02:36:30 +00:00
|
|
|
export default {
|
2016-03-11 04:40:08 +00:00
|
|
|
isOSX,
|
|
|
|
isWindows,
|
|
|
|
downloadFile
|
2016-01-27 02:36:30 +00:00
|
|
|
};
|