File tree 3 files changed +10
-6
lines changed
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change
1
+ ( async ( ) => {
2
+ const file = await fetch ( 'credentials.json' ) ;
3
+ console . log ( file ) ;
4
+ } ) ( )
Original file line number Diff line number Diff line change 1
1
console . log ( 'Bootstrapping.' ) ;
2
- import * as fs from 'fs' ;
3
2
4
3
interface Music {
5
4
name : string ;
@@ -53,10 +52,12 @@ const specify = () => {
53
52
} ) ;
54
53
}
55
54
56
- const credentials = JSON . parse ( fs . readFileSync ( 'credentials.json' , 'utf8' ) ) ;
57
- const updateProfile = ( music : Music ) => {
58
- const id = credentials . id ;
59
- const oauth = credentials . oauth ;
55
+ const updateProfile = async ( music : Music ) => {
56
+ const credentials = await ( await fetch ( 'credentials.json' ) ) . json ( ) ;
57
+ console . log ( credentials ) ;
58
+
59
+ const id = credentials [ 'id' ] ;
60
+ const oauth = credentials [ 'key' ] ;
60
61
const message = `now i'my playing ${ music . name } ` ;
61
62
const auth = `token ${ oauth } ` ;
62
63
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ const path = require('path');
3
3
const { join } = require ( 'path' ) ;
4
4
5
5
module . exports = {
6
- target : "node" ,
7
6
entry : {
8
7
background : join ( __dirname , 'src/background.ts' ) ,
9
8
} ,
You can’t perform that action at this time.
0 commit comments