[] 适合游戏人的 游戏搬砖 - 多开服务
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TARGET_VERSION="14" | |
| # 检查 nvm 是否已安装 | |
| if ! command -v nvm &> /dev/null; then | |
| echo "nvm is not installed. Installing nvm..." | |
| # 安装 nvm (这里仅提供了基本的安装命令,实际安装可能更复杂) | |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash | |
| export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const path = require('path'); | |
| function findRequireStatements(dir, results = []) { | |
| const files = fs.readdirSync(dir); | |
| files.forEach(file => { | |
| const filePath = path.join(dir, file); | |
| const stats = fs.statSync(filePath); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const path = require('path'); | |
| const directoryPath = './your_directory_path'; | |
| function replaceRequiresWithImports(directoryPath) { | |
| fs.readdir(directoryPath, (err, files) => { | |
| if (err) { | |
| console.error('Error reading directory:', err); | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| module.exports = { | |
| types: [ | |
| {value: 'feat', name: '特性: 一个新的特性'}, | |
| {value: 'fix', name: '修复: 修复一个Bug'}, | |
| {value: 'docs', name: '文档: 变更的只有文档'}, | |
| {value: 'style', name: '格式: 空格, 分号等格式修复'}, | |
| {value: 'refactor', name: '重构: 代码重构,注意和特性、修复区分开'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "lint": "eslint --ext .js --ext .vue src/", | |
| "lint-fix": "eslint --fix --ext .js --ext .vue src/", | |
| "prettier-fix": "prettier --write 'src/**/*.json' 'src/**/*.md' ", | |
| "husky": { | |
| "hooks": { | |
| "pre-commit": "lint-staged" | |
| } | |
| }, | |
| "lint-staged": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| env: { | |
| browser: true, | |
| es6: true, | |
| }, | |
| extends: [ | |
| 'eslint:recommended', | |
| 'airbnb-base', | |
| 'plugin:prettier/recommended', | |
| 'plugin:vue/essential', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| globals: { | |
| require: true, | |
| process: true, | |
| module: true, | |
| }, | |
| env: { | |
| browser: true, | |
| es6: true, | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const check_webp_support = () => { | |
| return new Promise( reslove => { | |
| let img = new Image(); | |
| img.onload = function () { | |
| let result = (img.width > 0) && (img.height > 0); | |
| reslove(result) | |
| }; | |
| img.onerror = function () { | |
| reslove(false) | |
| }; |
NewerOlder