When, by the judgment of the appellate court upon cases of habeas corpus, the applicant is ordered to give bail, such judgment shall be certified to the officer holding him in custody; and if such officer be the sheriff, the bail bond may be executed before him; if any other officer, he shall take the person detained before some magistrate, who may receive a bail bond, and shall file the same in the proper court of the proper county; and such bond may be forfeited and enforced as provided by law.
Tex. Code Crim. Proc. § 44.41