kě​zhe​tóu​zuò​mào​zi

to cut one's coat according to one's cloth