The Shulchan Aruch · Orach Chayim
אורח חיים תקל״גOrach Chayim 533
Siman 533 of 697 in Orach Chayim — 5 se'ifim
הלכות חול המועדLaws of Chol HaMoed· siman 533
Se’if 1א׳
מֻתָּר לִטְחֹן קֶמַח לְצֹרֶךְ הַמּוֹעֵד, אֲפִלּוּ כִּוֵּן מְלַאכְתּוֹ בַּמּוֹעֵד, וְלָקֹץ עֵצִים מֵהַמְחֻבָּר וּלְהַטִּיל שֵׁכָר, בֵּין שֶׁל תְּמָרִים בֵּין שֶׁל שְׂעוֹרִים, לְצֹרֶךְ הַמּוֹעֵד; וְשֶׁלֹּא לְצֹרֶךְ הַמּוֹעֵד, אָסוּר. וּמִיהוּ אֵינוֹ צָרִיךְ לְצַמְצֵם, אֶלָּא עוֹשֶׂה בְּהַרְוָחָה, וְאִם יוֹתִיר יוֹתִיר; אֲבָל לֹא יַעֲרִים לִטְחֹן אוֹ לַעֲשׂוֹת שֵׁכָר יוֹתֵר, בְּכַוָּנָה, אוֹ אִם יֵשׁ לוֹ קֶמַח אוֹ שֵׁכָר יָשָׁן לֹא יַעֲרִים לַעֲשׂוֹת אַחֵר וְיֹאמַר: מִזֶּה אֲנִי רוֹצֶה; אֲבָל אִם יֵשׁ לוֹ לֶחֶם, מֻתָּר לִטְחֹן לְפַת דְּפַת חַמָּה עָדִיף; וְהוּא הַדִּין בְּשֵׁכָר, אִם הֶחָדָשׁ עָדִיף, בְּלֹא הָעֲרָמָה שָׁרֵי (הַמַּגִּיד פ"ז).
Work that is Permitted on Chol HaMoed. Containing 5 paragraphs: It is permitted to grind flour for a holiday need, even if one planned to do thi on the holiday. [The same is true for] cutting trees from the ground or making mead, whether it is from dates or barley, for a holiday need. If it is not for a holiday need, it is forbidden. However, one need not minimize production - rather, one can make a lot, and if he makes too much, he makes too much. However, one should not circumvent the law by grinding too much or making too much (mead) intentionally. Alternatively, if one has flour (or old mead) he should not circumvent the law (to make more) and say, "I want from this [new] batch." However, if one has bread, he is permitted to grind [wheat] (for bread), because warm bread is preferrable. This is also the law for mead - if the new is actually better than the old, it is allowed (the Magid chapter 7).
Se’if 2ב׳
מֻתָּר לַעֲקֹר פִּשְׁתָּן, מִפְּנֵי שֶׁרָאוּי לְכַסוֹת בּוֹ אֶת הָאֳכָלִים; וְלַעֲקֹר כְּשׁוּת, שֶׁרָאוּי לְהַטִּיל בּוֹ שֵׁכָר לְצֹרֶךְ הַמּוֹעֵד; וְלַעֲקֹר שׂוּמְשֻׂמִין, שֶׁהַיְבֵשִׁים שֶׁבּוֹ רְאוּיִים לֶאֱכֹל מִיָּד.
It is permitted to uproot flax because it can be used to cover foods, to uproot hops because it can be used to make mead needed on the holiday, and to uproot sesame because the dry ones can be eaten immediately.
Se’if 3ג׳
פֵּרוֹת שֶׁנִּתְבַּשְּׁלוּ קְצָת וְנֶאֱכָלִין עַל יְדֵי הַדַּחַק, מֻתָּר לְלַקְּטָן כְּדֵי לְאָכְלָן; וְאִם לְקָטָן לְאָכְלָן וְהוֹתִיר, וְחוֹשֵׁשׁ שֶׁמָּא יַתְלִיעוּ אִם לֹא יִכְבְּשֵׁם לְהוֹצִיא לֵחָה מֵהֶם, יָכוֹל לְכָבְשָׁם. אֲבָל אָסוּר לְלַקְּטָם תְּחִלָּה כְּדֵי לְכָבְשָׁם; וְאִם הוּא דָּבָר שֶׁאֵינוֹ נִמְצָא אַחַר הַמּוֹעֵד, מֻתָּר לִקְנוֹתוֹ וּלְכָבְשׁוֹ.
If fruits have ripened a bit such that they can be eaten in a stretch, it is permitted to collect them in order to eat them. If one collected them to eat them, collected too much, and he now worries that they will rot if they are not pickled to remove the moisture, he can pickle them. However, it is forbidden to collect in order to pickle. If there is something that won't be available after the holiday, it is permitted to buy it and pickle it.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0