js-- || &&

/**
* 几乎所有语言中||和&&都遵循“短路”原理,
* 如&&中第一个表达式为假就不会去处理第二个表达式,而||正好相反。
* js也遵循上述原则。
* 当||时,找到为true的分项就停止处理,并返回该分项的值,否则执行完,并返回最后分项的值。
* 当&&时,找到为false的分项就停止处理,并返回该分项的值。
**/
// var a = "" || null || 3 || 4;//3
// alert(a);
// var b = 4 && 5 && null && "0";//null
// alert(b);
---- > [tauri-builder 2/9] RUN sed -i 's|http://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && sed -i 's|http://security.debian.org|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list && echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4 && apt-get update && apt-get install -y curl wget libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev pkg-config build-essential && rm -rf /var/lib/apt/lists/*: 0.314 sed: can't read /etc/apt/sources.list: No such file or directory ------ dockerfile:20 -------------------- 19 | # 更换为清华镜像源,并更新 20 | >>> RUN sed -i 's|http://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && \ 21 | >>> sed -i 's|http://security.debian.org|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list && \ 22 | >>> echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4 && \ 23 | >>> apt-get update && \ 24 | >>> apt-get install -y \ 25 | >>> curl \ 26 | >>> wget \ 27 | >>> libwebkit2gtk-4.1-dev \ 28 | >>> libappindicator3-dev \ 29 | >>> librsvg2-dev \ 30 | >>> patchelf \ 31 | >>> libssl-dev \ 32 | >>> pkg-config \ 33 | >>> build-essential \ 34 | >>> && rm -rf /var/lib/apt/lists/* 35 | -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c sed -i 's|http://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && sed -i 's|http://security.debian.org|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list && echo 'Acquire::ForceIPv4 \"true\";' > /etc/apt/apt.conf.d/99force-ipv4 && apt-get update && apt-get install -y curl wget libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev pkg-config build-essential && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 2
11-02
# ===== 第一阶段:前端构建(使用 LTS Node)===== FROM node:25-alpine AS frontend-builder WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build # ===== 第二阶段:Tauri 构建(使用 Debian 基础镜像)===== FROM rust:1.91.0 AS tauri-builder RUN sed -i 's|http://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && \ sed -i 's|http://security.debian.org|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list && \ apt-get update ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ curl \ wget \ libwebkit2gtk-4.1-dev \ libappindicator3-dev \ librsvg2-dev \ patchelf \ libssl-dev \ pkg-config \ build-essential \ && rm -rf /var/lib/apt/lists/* # 推荐使用 tauri-cli 而非 cargo-bundle RUN cargo install tauri-cli WORKDIR /app COPY --from=frontend-builder /app/dist ./dist COPY package.json . COPY src-tauri ./src-tauri RUN cd src-tauri && cargo build --release RUN cd src-tauri && cargo tauri bundle --release --format appimage # ===== 第三阶段:运行时镜像(使用稳定 Ubuntu)===== FROM ubuntu:25.04 AS runtime RUN sed -i 's|http://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && \ sed -i 's|http://security.debian.org|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list && \ apt-get update RUN apt-get update && apt-get install -y \ libwebkit2gtk-4.1-0 \ libgstreamer-plugins-base1.0-0 \ libgstreamer1.0-0 \ libappindicator3-1 \ librsvg2-2 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=tauri-builder /app/src-tauri/target/release/bundle/appimage/*.AppImage ./app.AppImage RUN chmod +x ./app.AppImage CMD ["./app.AppImage"] 这样对吗
11-02
-- optimize-css-assets-webpack-plugin@3.2.0 | `-- cssnano@3.10.0 | +-- autoprefixer@6.7.7 | | `-- postcss@5.2.18 deduped | +-- postcss-calc@5.3.1 | | `-- postcss@5.2.18 | +-- postcss-colormin@2.2.2 | | `-- postcss@5.2.18 | +-- postcss-convert-values@2.6.1 | | `-- postcss@5.2.18 | +-- postcss-discard-comments@2.0.4 | | `-- postcss@5.2.18 | +-- postcss-discard-duplicates@2.1.0 | | `-- postcss@5.2.18 | +-- postcss-discard-empty@2.1.0 | | `-- postcss@5.2.18 | +-- postcss-discard-overridden@0.1.1 | | `-- postcss@5.2.18 | +-- postcss-discard-unused@2.2.3 | | `-- postcss@5.2.18 | +-- postcss-filter-plugins@2.0.3 | | `-- postcss@5.2.18 | +-- postcss-merge-idents@2.1.7 | | `-- postcss@5.2.18 | +-- postcss-merge-longhand@2.0.2 | | `-- postcss@5.2.18 | +-- postcss-merge-rules@2.1.2 | | `-- postcss@5.2.18 | +-- postcss-minify-font-values@1.0.5 | | `-- postcss@5.2.18 | +-- postcss-minify-gradients@1.0.5 | | `-- postcss@5.2.18 | +-- postcss-minify-params@1.2.2 | | `-- postcss@5.2.18 | +-- postcss-minify-selectors@2.1.1 | | `-- postcss@5.2.18 | +-- postcss-normalize-charset@1.1.1 | | `-- postcss@5.2.18 | +-- postcss-normalize-url@3.0.8 | | `-- postcss@5.2.18 | +-- postcss-ordered-values@2.2.3 | | `-- postcss@5.2.18 | +-- postcss-reduce-idents@2.4.0 | | `-- postcss@5.2.18 | +-- postcss-reduce-initial@1.0.1 | | `-- postcss@5.2.18 | +-- postcss-reduce-transforms@1.0.4 | | `-- postcss@5.2.18 | +-- postcss-svgo@2.1.6 | | `-- postcss@5.2.18 | +-- postcss-unique-selectors@2.0.2 | | `-- postcss@5.2.18 | +-- postcss-zindex@2.2.0 | | `-- postcss@5.2.18 | `-- postcss@5.2.18 +-- postcss-loader@7.3.4
最新发布
11-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值