Can `dfx` do some post_install terminal commands in dfx.json?

{
  "dfx": "0.17.0",
  "canisters": {
    "assets": {
      "dependencies": [],
      "frontend": {
        "entrypoint": "dist/index.html"
      },
      "source": ["dist/"],
      "type": "assets"
    },
    "backend": {
      "candid": "backend/canisters/backend/backend.did",
      "package": "backend",
      "type": "rust",
//something semantics like this :
      "post_install": [
        "cargo build --release --target wasm32-unknown-unknown --package backend && candid-extractor target/wasm32-unknown-unknown/release/backend.wasm >./backend/canisters/backend/backend.did"
      ]
    }
  },
  "networks": {
    "local": {
      "bind": "127.0.0.1:40010",
      "type": "ephemeral",
      "replica": {
        "subnet_type": "system"
      }
    },
    "ic": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    },
    "ic_test": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    },
    "web_test": {
      "providers": ["https://ic0.app/"],
      "type": "persistent"
    }
  },
  "defaults": {
    "build": {
      "args": "",
      "packtool": ""
    }
  },
  "output_env_file": ".env",
  "version": 1
}

Also if got some pre_install cmd will be great . like run npm i before dfx deploy

I figure out it by doing this :

  "dfx": "0.17.0",
  "canisters": {
    "assets": {
      "dependencies": [],
      "frontend": {
        "entrypoint": "dist/index.html"
      },
      "source": ["dist/"],
      "type": "assets"
    },
    "backend": {
      "candid": "backend/canisters/backend/backend.did",
      "package": "backend",
      "type": "rust",
      "post_install": [
        "./backend/scripts/post_install.sh"
      ]
    }
  },
#!/bin/bash
echo post_install task: candid-extractor
candid-extractor target/wasm32-unknown-unknown/release/backend.wasm >./backend/canisters/backend/backend.did

tip: remember to give the bash file excute permit.