Opened 2 years ago

Last modified 23 months ago

#6544 closed enhancement

List of unused data json files — at Initial Version

Reported by: Langbart Owned by:
Priority: If Time Permits Milestone: Alpha 26
Component: Simulation Keywords:
Cc: Patch:

Description

Aura

Name Removed from template with
structures/rotary_mill [25561]
units/han_minister_cost unused in the main game
units/elephant_worker [26898]

Technologies

Name Removed from template with
upgrade_rank_advanced_crossbow unused in the main game
upgrade_rank_elite_crossbow unused in the main game
pair_unlock_arrows_type [26469]
shell function

used for finding unlisted data json files in the simulation folder

function dataU {
  CURRENT_DIR=$(pwd)
  cd ~/0ad/binaries/data/mods/public/simulation/data/auras
  echo "\e[1;97mList unused Auras:\e[0m"
  for a in $(find . -name "*.json" | grep -oe '[A-Za-z0-9_].*' | sed 's|.json||'); do
    if [[ $(grep --include=\*.xml -rnw ~/0ad/binaries/data/mods/public/simulation -e $a | wc -c) -eq 0 ]]; then
      echo "$a"
    fi
  done
  cd ~/0ad/binaries/data/mods/public/simulation/data/technologies
  echo "\e[1;97m\nList unused Technologies:\e[0m"
  for t in $(find . -name "*.json" | xargs grep -Le 'autoResearch.*true' | grep -oe '[A-Za-z0-9_].*' | sed 's|.json||'); do
    if [[ $(grep --include={*.xml,*.js} -rnw ~/0ad/binaries/data/mods/public/simulation -e $t | wc -c) -eq 0 ]]; then
      echo "$t"
    fi
  done
  cd "${CURRENT_DIR}"
}

related tickets

Change History (0)

Note: See TracTickets for help on using tickets.