5
5
*/
6
6
import { join } from "../../../src/deno_ral/path.ts" ;
7
7
import { info } from "../../../src/deno_ral/log.ts" ;
8
+ import { logPandoc } from "../../../src/core/log.ts" ;
8
9
9
10
import { execProcess } from "../../../src/core/process.ts" ;
10
11
import { Configuration , withWorkingDir } from "./config.ts" ;
@@ -34,7 +35,7 @@ export function archiveUrl(
34
35
// Archives dependencies (if they are not present in the archive already)
35
36
export async function archiveBinaryDependencies ( _config : Configuration ) {
36
37
await withWorkingDir ( async ( workingDir ) => {
37
- info ( ` Updating binary dependencies...\n `) ;
38
+ await logPandoc ( `## Updating binary dependencies`) ;
38
39
39
40
for ( const dependency of kDependencies ) {
40
41
await archiveBinaryDependency ( dependency , workingDir ) ;
@@ -45,7 +46,7 @@ export async function archiveBinaryDependencies(_config: Configuration) {
45
46
// Archives dependencies (if they are not present in the archive already)
46
47
export async function checkBinaryDependencies ( _config : Configuration ) {
47
48
await withWorkingDir ( async ( workingDir ) => {
48
- info ( `Updating binary dependencies...\n `) ;
49
+ await logPandoc ( `## Checking binary dependencies`) ;
49
50
50
51
for ( const dependency of kDependencies ) {
51
52
await checkBinaryDependency ( dependency , workingDir ) ;
@@ -99,10 +100,9 @@ export async function archiveBinaryDependency(
99
100
dependency : Dependency ,
100
101
workingDir : string ,
101
102
) {
102
- info ( `** ${ dependency . name } ${ dependency . version } **` ) ;
103
+ await logPandoc ( `## ${ dependency . name } ${ dependency . version } \n\nChecking archive status...` , "markdown" ) ;
103
104
104
105
const dependencyBucketPath = `${ dependency . bucket } /${ dependency . version } ` ;
105
- info ( "Checking archive status...\n" ) ;
106
106
107
107
const archive = async (
108
108
architectureDependency : ArchitectureDependency ,
@@ -117,7 +117,7 @@ export async function archiveBinaryDependency(
117
117
118
118
const dependencyAwsPath =
119
119
`${ kBucket } /${ dependencyBucketPath } /${ platformDep . filename } ` ;
120
- info ( `Checking ${ dependencyAwsPath } ` ) ;
120
+ await logPandoc ( `Checking \` ${ dependencyAwsPath } \`` , "markdown" ) ;
121
121
const response = await s3cmd ( "ls" , [ dependencyAwsPath ] ) ;
122
122
if ( response ?. includes ( 'Unable to locate credentials' ) ) {
123
123
throw new Error ( "Unable to locate S3 credentials, please try again." ) ;
@@ -126,8 +126,8 @@ export async function archiveBinaryDependency(
126
126
127
127
if ( ! response ) {
128
128
// This dependency doesn't exist, archive it
129
- info (
130
- `Archiving ${ dependencyBucketPath } - ${ platformDep . filename } ` ,
129
+ await logPandoc (
130
+ `Archiving \` ${ dependencyBucketPath } \` - ${ platformDep . filename } ` ,
131
131
) ;
132
132
133
133
// Download the file
@@ -144,23 +144,18 @@ export async function archiveBinaryDependency(
144
144
"--acl" ,
145
145
"public-read" ,
146
146
] ) ;
147
-
148
- info ( `(Reponse): ${ result } ` ) ;
149
-
147
+ info ( ` (Response): ${ result } ` ) ;
150
148
} else {
151
- info ( `${ dependencyAwsPath } already archived.` ) ;
149
+ info ( ` ${ dependencyAwsPath . split ( "/" ) . slice ( - 1 ) [ 0 ] } already archived.\n ` ) ;
152
150
}
153
151
}
154
152
}
155
153
} ;
156
154
157
155
for ( const arch of Object . keys ( dependency . architectureDependencies ) ) {
158
- info ( `Archiving ${ dependency . name } ` ) ;
159
156
const archDep = dependency . architectureDependencies [ arch ] ;
160
157
await archive ( archDep ) ;
161
158
}
162
-
163
- info ( "" ) ;
164
159
}
165
160
166
161
async function s3cmd ( cmd : string , args : string [ ] ) {
0 commit comments