1
- use std:: io:: Read ;
2
1
use colored:: Colorize ;
2
+ use std:: io:: Read ;
3
3
4
4
use edgee_api_client:: types as api_types;
5
5
use reqwest:: get;
@@ -101,11 +101,7 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
101
101
{
102
102
tracing:: info!(
103
103
"Component {} does not exist yet!" ,
104
- format!(
105
- "{}/{}" ,
106
- organization. slug,
107
- & component_slug,
108
- ) . green( ) ,
104
+ format!( "{}/{}" , organization. slug, & component_slug) . green( ) ,
109
105
) ;
110
106
let confirm = Confirm :: new ( "Confirm new component creation?" )
111
107
. with_default ( true )
@@ -160,25 +156,18 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
160
156
. api_context ( "Could not create component" ) ?;
161
157
tracing:: info!(
162
158
"Component {} created successfully!" ,
163
- format!(
164
- "{}/{}" ,
165
- organization. slug,
166
- component_slug,
167
- ) . green( ) ,
159
+ format!( "{}/{}" , organization. slug, component_slug) . green( ) ,
168
160
) ;
169
161
170
162
( false , component. into_inner ( ) )
171
163
}
172
164
Ok ( res) => {
173
165
tracing:: info!(
174
166
"Component {} found!" ,
175
- format!(
176
- "{}/{}" ,
177
- organization. slug, & component_slug,
178
- ) . green( ) ,
167
+ format!( "{}/{}" , organization. slug, & component_slug) . green( ) ,
179
168
) ;
180
169
( true , res. into_inner ( ) )
181
- } ,
170
+ }
182
171
Err ( err) => anyhow:: bail!( "Error contacting API: {}" , err. into_message( ) ) ,
183
172
} ;
184
173
@@ -188,21 +177,27 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
188
177
"{} already exists in the registry.\n Did you forget to update the manifest?" ,
189
178
format!(
190
179
"{}/{}@{}" ,
191
- organization. slug, component_slug, manifest. component. version,
192
- ) . green( ) ,
180
+ organization. slug, component_slug, manifest. component. version
181
+ )
182
+ . green( ) ,
193
183
) ;
194
184
}
195
185
196
186
let changelog = Editor :: new ( "Describe the new version changelog (optional)" )
197
- . with_help_message ( "Type (e) to open the default editor. Use the EDITOR env variable to change it." )
187
+ . with_help_message (
188
+ "Type (e) to open the default editor. Use the EDITOR env variable to change it." ,
189
+ )
198
190
. prompt_skippable ( ) ?;
199
191
200
192
let confirm = Confirm :: new ( & format ! (
201
193
"Ready to push {}. Confirm?" ,
202
194
format!(
203
195
"{}/{}@{}" ,
204
- organization. slug, component_slug, manifest. component. version. clone( )
205
- ) . green( ) ,
196
+ organization. slug,
197
+ component_slug,
198
+ manifest. component. version. clone( )
199
+ )
200
+ . green( ) ,
206
201
) )
207
202
. with_default ( true )
208
203
. prompt ( ) ?;
@@ -277,10 +272,7 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
277
272
. api_context ( "Could not update component infos" ) ?;
278
273
tracing:: info!(
279
274
"Component {} updated successfully!" ,
280
- format!( "{}/{}" ,
281
- organization. slug,
282
- component_slug,
283
- ) . green( ) ,
275
+ format!( "{}/{}" , organization. slug, component_slug, ) . green( )
284
276
) ;
285
277
}
286
278
@@ -306,18 +298,17 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
306
298
"{} pushed successfully!" ,
307
299
format!(
308
300
"{}/{}@{}" ,
309
- organization. slug,
310
- component_slug,
311
- manifest. component. version,
312
- ) . green( ) ,
301
+ organization. slug, component_slug, manifest. component. version
302
+ )
303
+ . green( ) ,
313
304
) ;
314
305
tracing:: info!(
315
306
"URL: {}" ,
316
307
format!(
317
308
"https://www.edgee.cloud/~/registry/{}/{}" ,
318
- organization. slug,
319
- component_slug ,
320
- ) . green( ) ,
309
+ organization. slug, component_slug
310
+ )
311
+ . green( ) ,
321
312
) ;
322
313
323
314
Ok ( ( ) )
0 commit comments