fix(cli): cargo config path and ci template in new command

This commit is contained in:
LongYinan 2021-09-15 00:13:08 +08:00
parent c5828be4b0
commit c3852543a5
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
2 changed files with 5 additions and 5 deletions

View file

@ -62,14 +62,14 @@ jobs:
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
build: | build: |
yarn build --target=aarch64-unknown-linux-gnu yarn build --target=aarch64-unknown-linux-gnu
aarch64-linux-gnu-strip \${{ env.APP_NAME }}.linux-arm64-gnu.node aarch64-linux-gnu-strip ${app}.linux-arm64-gnu.node
- host: ubuntu-latest - host: ubuntu-latest
target: 'armv7-unknown-linux-gnueabihf' target: 'armv7-unknown-linux-gnueabihf'
setup: | setup: |
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: | build: |
yarn build --target=armv7-unknown-linux-gnueabihf yarn build --target=armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip \${{ env.APP_NAME }}.linux-arm-gnueabihf.node arm-linux-gnueabihf-strip ${app}.linux-arm-gnueabihf.node
- host: ubuntu-latest - host: ubuntu-latest
target: 'aarch64-linux-android' target: 'aarch64-linux-android'
build: | build: |
@ -83,7 +83,7 @@ jobs:
docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
build: | build: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/${app} -w /${app} builder sh -c "yarn build -- --target=aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip ${app}.linux-arm64-musl.node" docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder sh -c "yarn build --target=aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip ${app}.linux-arm64-musl.node"
- host: windows-latest - host: windows-latest
target: 'aarch64-pc-windows-msvc' target: 'aarch64-pc-windows-msvc'
build: yarn build --target aarch64-pc-windows-msvc build: yarn build --target aarch64-pc-windows-msvc

View file

@ -170,10 +170,10 @@ export class NewProjectCommand extends Command {
enableLinuxArm8Musl, enableLinuxArm8Musl,
) )
if (cargoConfig.length) { if (cargoConfig.length) {
const configDir = join(process.cwd(), this.dirname!, '.config') const configDir = join(process.cwd(), this.dirname!, '.cargo')
if (!this.dryRun) { if (!this.dryRun) {
mkdirSync(configDir) mkdirSync(configDir)
this.writeFile(join('.config', 'config.toml'), cargoConfig) this.writeFile(join('.cargo', 'config.toml'), cargoConfig)
} }
} }
} }