@@ -15,38 +15,34 @@ const dist = Path.join( root, 'dist' )
1515const tempSubDir = root . split ( 'software' ) [ 1 ]
1616const publishFromDir = Path . join ( '/mnt/c/software/temp' , tempSubDir , 'dist' )
1717
18- console . log ( tempSubDir )
19- console . log ( publishFromDir )
20-
21-
22- // await Promise.resolve()
23- // .then( () => console.log( 'Publishing...' ) )
24-
25- // .then( async () => {
26- // await rm( publishFromDir, { recursive: true } )
27- // .then( () => console.log( 'publishFromDir: deleted' ) )
28- // .catch( logError( { publishFromDir } ) )
29- // } )
30-
31- // .then( async () => {
32- // const section = 'publishFromDir: moved all files'
33- // await cp( dist, publishFromDir, { recursive: true } )
34- // .then( () => console.log( section ) )
35- // .catch( logError( { section, dist, publishFromDir } ) )
36- // } )
37-
38- // .then( async () => {
39- // const section = 'npm publish'
40- // await $`cd ${ publishFromDir } && npm publish --access public`
41- // .then( () => console.log( 'npm publish: ran' ) )
42- // .catch( logError( { section } ) )
43- // } )
44-
45- // .then( async () => {
46- // await rm( publishFromDir, { recursive: true } )
47- // .then( () => console.log( 'publishFromDir: deleted' ) )
48- // .catch( logError( { publishFromDir } ) )
49- // } )
50-
51- // .then( () => console.log( 'Publish: done' ) )
52- // .catch( logError( { path: import.meta.path } ) )
18+ await Promise . resolve ( )
19+ . then ( ( ) => console . log ( 'Publishing...' ) )
20+
21+ . then ( async ( ) => {
22+ await rm ( publishFromDir , { recursive : true } )
23+ . then ( ( ) => console . log ( 'publishFromDir: deleted' ) )
24+ . catch ( logError ( { publishFromDir } ) )
25+ } )
26+
27+ . then ( async ( ) => {
28+ const section = 'publishFromDir: moved all files'
29+ await cp ( dist , publishFromDir , { recursive : true } )
30+ . then ( ( ) => console . log ( section ) )
31+ . catch ( logError ( { section, dist, publishFromDir } ) )
32+ } )
33+
34+ . then ( async ( ) => {
35+ const section = 'npm publish'
36+ await $ `cd ${ publishFromDir } && npm publish --access public`
37+ . then ( ( ) => console . log ( 'npm publish: ran' ) )
38+ . catch ( logError ( { section } ) )
39+ } )
40+
41+ . then ( async ( ) => {
42+ await rm ( publishFromDir , { recursive : true } )
43+ . then ( ( ) => console . log ( 'publishFromDir: deleted' ) )
44+ . catch ( logError ( { publishFromDir } ) )
45+ } )
46+
47+ . then ( ( ) => console . log ( 'Publish: done' ) )
48+ . catch ( logError ( { path : import . meta. path } ) )
0 commit comments