-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.mjs
32 lines (30 loc) · 1.07 KB
/
install.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { createWriteStream } from 'fs';
import fetch from 'node-fetch';
import StreamZip from 'node-stream-zip';
const url =
'https://github.com/msintuneappsdk/ms-intune-app-sdk-ios/archive/refs/heads/main.zip';
await fetch(url).then(async res => {
res.body.pipe(createWriteStream('main.zip'));
// wait for stream write to complete
await new Promise(resolve => {
res.body.on('end', resolve);
});
const zip = new StreamZip.async({ file: 'main.zip' });
// console.log(Object.values((await zip.entries())).filter(entry => entry.name.includes('IntuneMAMConfigurator')));
await zip.extract(
'ms-intune-app-sdk-ios-main/IntuneMAMConfigurator',
'./ios/IntuneMAMConfigurator',
);
await zip.extract(
'ms-intune-app-sdk-ios-main/IntuneMAMSwift.xcframework',
'./ios/IntuneMAMSwift.xcframework',
);
await zip.extract(
'ms-intune-app-sdk-ios-main/IntuneMAMSwiftStub.xcframework',
'./ios/IntuneMAMSwiftStub.xcframework',
);
await zip.extract(
'ms-intune-app-sdk-ios-main/IntuneMAMResources.bundle',
'./ios/IntuneMAMResources.bundle',
);
});