Skip to content

Commit

Permalink
fix: use quote.txt instead of dist/quote.txt to avoid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmeow committed Mar 3, 2024
1 parent 7b9a0f4 commit 8a5c5ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var c=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var p=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of l(e))!h.call(t,n)&&n!==o&&c(t,n,{get:()=>e[n],enumerable:!(r=a(e,n))||r.enumerable});return t};var g=t=>p(c({},"__esModule",{value:!0}),t);var u={};module.exports=g(u);var i=require("path"),s=require("fs/promises");(async()=>{let t=await fetch("https://v0.elegant.tw/all").then(o=>o.json()),e=`${t.sentence}
\u2014\u2014${t.author!==null?t.author:t.cite}
var c=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var p=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l(t))!h.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(r=a(t,n))||r.enumerable});return e};var g=e=>p(c({},"__esModule",{value:!0}),e);var u={};module.exports=g(u);var i=require("path"),s=require("fs/promises");(async()=>{let e=await fetch("https://v0.elegant.tw/all").then(o=>o.json()),t=`${e.sentence}
\u2014\u2014${e.author!==null?e.author:e.cite}
\u65BC ${new Date().toLocaleString("zh-TW",{timeZone:"Asia/Taipei",hourCycle:"h23"})} \u66F4\u65B0`;console.log(`
${e}
`);try{await(0,s.writeFile)((0,i.join)(process.cwd(),"dist/quote.txt"),e)}catch(o){console.error(`FATAL: ${o}`),process.exit(1)}console.log(`INFO: \u6210\u529F\u5132\u5B58\u3002
${t}
`);try{await(0,s.writeFile)((0,i.join)(process.cwd(),"quote.txt"),t)}catch(o){console.error(`FATAL: ${o}`),process.exit(1)}console.log(`INFO: \u6210\u529F\u5132\u5B58\u3002
`)})();
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface Resp {
console.log(`\n${content}\n`)

try {
await writeFile(join(process.cwd(), 'dist/quote.txt'), content)
await writeFile(join(process.cwd(), 'quote.txt'), content)
} catch (err) {
console.error(`FATAL: ${err}`)
process.exit(1)
Expand Down

0 comments on commit 8a5c5ff

Please sign in to comment.