delete gitignore_merge.*

This commit is contained in:
luk
2026-10-07 10:45:19 +08:00
parent 093663f62d
commit f743ce02ef
5 changed files with 42 additions and 85 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
# npm run app-ios-boot -- FF429526-A7EE-… # 直接给 UDID
# [email protected] npm run app-ios-boot # 用环境变量改默认
#
# 短名表见 scripts/emuResolveIos.js 的 builtinAlias(ip16 / ip16plus / ip16pro / ip16pm),
# 短名表见 emuResolveIos.js 的 builtinAlias(ip16 / ip16plus / ip16pro / ip16pm),
# 也可以在 package.json 的 config 里加("ipad": "iPad Pro 13-inch (M4)")。
#
# 跑 App 永远打「当前已启动的那台」(纯 booted 语义):
+11 -21
View File
@@ -1,10 +1,10 @@
#!/usr/bin/env node
// 把「短名@系统版本」解析成本机真实存在的模拟器 UDID(供 emuBootIos.sh 调用)。
//
// node scripts/emuResolveIos.js [email protected] # 短名(见下面别名表)
// node scripts/emuResolveIos.js "iPhone [email protected]" # 写机型全名也行
// node scripts/emuResolveIos.js "iPhone 16" # 不给版本 → 取系统版本最高的那台
// node scripts/emuResolveIos.js FF429526-… # 本来就是 UDID → 原样返回
// node emuResolveIos.js [email protected] # 短名(见下面别名表)
// node emuResolveIos.js "iPhone [email protected]" # 写机型全名也行
// node emuResolveIos.js "iPhone 16" # 不给版本 → 取系统版本最高的那台
// node emuResolveIos.js FF429526-… # 本来就是 UDID → 原样返回
//
// 为什么不用 UDID:UDID 是每台 Mac 各自生成的,换台机器就失效。
// 机型名 + 系统版本是 Xcode 自带的,任何机器上都能查到,所以跨机器可移植。
@@ -19,7 +19,7 @@ const builtinAlias = {
ip16: 'iPhone 16',
ip16plus: 'iPhone 16 Plus',
ip16pro: 'iPhone 16 Pro',
ip16pm: 'iPhone 16 Pro Max'
ip16pm: 'iPhone 16 Pro Max',
}
const rootDir = path.resolve(__dirname, '..')
@@ -30,13 +30,9 @@ try {
pkgConfig = {}
}
const input =
(process.argv[2] || '').trim() ||
String(pkgConfig.defaultIosEmu || '[email protected]').trim()
const input = (process.argv[2] || '').trim() || String(pkgConfig.defaultIosEmu || '[email protected]').trim()
if (
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(input)
) {
if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(input)) {
console.log(input)
process.exit(0)
}
@@ -52,11 +48,9 @@ const version =
.replace(/^iOS\s*/i, '')
const deviceName = pkgConfig[left] || builtinAlias[left.toLowerCase()] || left
const json = JSON.parse(
execSync('xcrun simctl list devices available -j').toString()
)
const runtimeKeyFor = want => `iOS-${want.replace(/\./g, '-')}`
const versionOf = runtimeKey => {
const json = JSON.parse(execSync('xcrun simctl list devices available -j').toString())
const runtimeKeyFor = (want) => `iOS-${want.replace(/\./g, '-')}`
const versionOf = (runtimeKey) => {
const matched = runtimeKey.match(/iOS-(\d+)(?:-(\d+))?/)
return matched ? [Number(matched[1]), Number(matched[2] || 0)] : [0, 0]
}
@@ -77,11 +71,7 @@ for (const [runtimeKey, devices] of Object.entries(json.devices)) {
}
if (matched.length === 0) {
console.error(
`❌ 本机没有匹配的模拟器:${input}(机型「${deviceName}」${
version ? ` + iOS ${version}` : ''
})`
)
console.error(`❌ 本机没有匹配的模拟器:${input}(机型「${deviceName}」${version ? ` + iOS ${version}` : ''})`)
console.error(' 看有哪些:xcrun simctl list devices available')
process.exit(1)
}
-41
View File
@@ -1,41 +0,0 @@
const https = require('https')
const fs = require('fs')
const path = require('path')
console.log('\n::*** Merge remote and local gitignore files to .gitignore')
// 下载远程 .gitignore_global 内容,不保存中间文件
const remoteUrl = 'https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global'
console.log('::--- fetching remote file:', remoteUrl)
https
.get(remoteUrl, (res) => {
if (res.statusCode !== 200) {
console.error(`::--- failed to download: status ${res.statusCode}`)
return
}
let globalContent = ''
res.setEncoding('utf8')
res.on('data', (chunk) => {
globalContent += chunk
})
res.on('end', () => {
const gitignoreLocalPath = path.resolve('./.gitignore.local.txt')
console.log('::--- merging with local file:', gitignoreLocalPath)
const gitignorePath = path.resolve('./.gitignore')
console.log('::--- into final result:', gitignorePath)
// 追加本地文件内容(如果存在)
let localContent = ''
if (fs.existsSync(gitignoreLocalPath)) {
localContent = fs.readFileSync(gitignoreLocalPath, 'utf8')
}
// 合并写入 .gitignore
fs.writeFileSync(gitignorePath, globalContent + '\n' + localContent)
console.log('::--- Merged successfully!')
})
})
.on('error', (err) => {
console.error('::--- download error:', err.message)
})
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
echo ::*** Merge remote [.gitignore_global] and local [.gitignore.local.txt] to [.gitignore]
curl -sSL https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global > .gitignore
if [ -f .gitignore.local.txt ]; then cat .gitignore.local.txt >> .gitignore; fi;
echo
# usage in package.json:
# "to_merge_gitignore.sh": "curl -sSL https://git.tic.cc/opx/sysconfig/raw/branch/main/gitignore_merge.sh | bash",
+30 -13
View File
@@ -7,6 +7,7 @@
# seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。
### seafile-ignore.global.txt ###
### global ignore settings in opx/sysconfig/nixhome/seafile-ignore.global.txt
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
@@ -53,21 +54,9 @@ _desktop.ini
~$*
*/~$*
## nodejs caches
node_modules/
*/node_modules/
## python caches
.venv/
*/.venv/
.pytest_cache/
*/.pytest_cache/
.ruff_cache/
*/.ruff_cache/
__pycache__/
*/__pycache__/
pages4loader.json5
*/pages4loader.json5
@@ -92,5 +81,33 @@ OneDrive/Icon
.wrangler/
*/.wrangler/
### seafile-ignore.local.txt ###
.playwright-mcp/
*/.playwright-mcp/
# Flutter/Dart 机器本地产物(各端由 `flutter pub get` / `pod install` / 构建在本机重生成,不跨机同步)。
# 双机开发时 .dart_tool/package_config.json 内是绝对路径(file:///Users/<用户>/.pub-cache/...),同步过去会让另一台机器编译报 No such file or directory。
# 注:pub 缓存在 ~/.pub-cache,位于资料库根之外,seafile 同步不到,无需在此列出。
# 注:build/ 未全局忽略,以防波及用了该常见词的目录;按需放各项目 seafile-ignore.local.txt。
# ---- Dart / Flutter:包解析 + 构建产物(核心,换机必跑 `flutter pub get` 重生成)----
.dart_tool/
*/.dart_tool/
.flutter-plugins-dependencies
*/.flutter-plugins-dependencies
build/
*/build/
# ---- iOS / macOS:CocoaPods 检出目录(Podfile.lock 仍提交共享,只忽略 Pods/ 实体)----
Pods/
*/Pods/
# ---- Android:本机 SDK 路径 + 构建缓存(换机必跑 `flutter build` 重生成 local.properties)----
local.properties
*/local.properties
.gradle/
*/.gradle/
.kotlin/
*/.kotlin/
### seafile-ignore.local.txt ###
### Followings are project-specific ignore settings merged by opx/sysconfig/seafile_ignore_find2merge.js