mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-07 07:31:43 +08:00
🎨 Style(custom): lint code
This commit is contained in:
@@ -5,7 +5,7 @@ import path from 'node:path'
|
||||
import axios from 'axios'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
import pkg from '../package.json' with { type: 'json'}
|
||||
import pkg from '../package.json' with { type: 'json' }
|
||||
const version = process.argv[2] || pkg.version
|
||||
|
||||
// Configuration
|
||||
@@ -26,7 +26,7 @@ const files = [
|
||||
/**
|
||||
* Create progress bar string
|
||||
*/
|
||||
function getProgressBar (current, total, length = 20) {
|
||||
function getProgressBar(current, total, length = 20) {
|
||||
const progress = Math.round((current / total) * length)
|
||||
const percentage = Math.round((current / total) * 100)
|
||||
const bar = '█'.repeat(progress) + '░'.repeat(length - progress)
|
||||
@@ -36,7 +36,7 @@ function getProgressBar (current, total, length = 20) {
|
||||
/**
|
||||
* Format bytes to human-readable format
|
||||
*/
|
||||
function formatBytes (bytes, decimals = 2) {
|
||||
function formatBytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes'
|
||||
const k = 1024
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB']
|
||||
@@ -47,7 +47,7 @@ function formatBytes (bytes, decimals = 2) {
|
||||
/**
|
||||
* Download file and calculate SHA256 hash
|
||||
*/
|
||||
async function downloadAndHash (fileInfo) {
|
||||
async function downloadAndHash(fileInfo) {
|
||||
const { url, name } = fileInfo
|
||||
const filePath = path.join(DOWNLOAD_DIR, name)
|
||||
|
||||
@@ -103,7 +103,7 @@ async function downloadAndHash (fileInfo) {
|
||||
/**
|
||||
* Main function
|
||||
*/
|
||||
async function main () {
|
||||
async function main() {
|
||||
console.log(`Generating SHA256 hashes for PicList v${version}`)
|
||||
console.log(`Download directory: ${DOWNLOAD_DIR}`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user