“At that time Joshua imposed this curse: The man who undertakes the rebuilding of this city, Jericho, is cursed before the Lord. He will lay its foundation at the cost of his firstborn; he will set up its gates at the cost of his youngest. And the Lord was with Joshua, and his fame spread throughout the land.”
Joshua 6:26-27 HCSB
https://www.bible.com/72/jos.6.26-27.hcsb
I read this and think the Lord is with us if we love what He loves and hate what He hates. Joshua laid waste to Jericho, then cursed it to never be rebuilt. Then the Lord made his name great.