-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
51 lines (41 loc) · 1.22 KB
/
index.ts
File metadata and controls
51 lines (41 loc) · 1.22 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bun
import { intro, outro } from '@clack/prompts';
import { showLobby, selectPath, selectItems } from './src/ui';
import { transfer } from './src/transfer';
/**
* Main function
*/
async function main() {
intro('ADB Transfer Tool');
// Step 1: Show lobby and select direction
const direction = await showLobby();
if (!direction) {
outro('Transfer cancelled');
return;
}
// Determine source and destination types based on direction
const sourceType = direction === 'pc-to-phone' ? 'pc' : 'phone';
const destinationType = direction === 'pc-to-phone' ? 'phone' : 'pc';
// Step 2: Select source path
const sourcePath = await selectPath(sourceType);
if (!sourcePath) {
outro('Transfer cancelled');
return;
}
// Step 3: Select items from source
const items = await selectItems(sourcePath, sourceType);
if (!items || items.length === 0) {
outro('No items selected');
return;
}
// Step 4: Select destination path
const destinationPath = await selectPath(destinationType);
if (!destinationPath) {
outro('Transfer cancelled');
return;
}
// Step 5: Execute transfer
await transfer(items, destinationPath, direction);
outro('Transfer complete');
}
main();