Skip to content

Commit

Permalink
remove mk code proposal script
Browse files Browse the repository at this point in the history
  • Loading branch information
tenmoves committed Mar 17, 2023
1 parent 372bea2 commit 45a4723
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
31 changes: 0 additions & 31 deletions lib/archethic/governance/code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -160,37 +160,6 @@ defmodule Archethic.Governance.Code do
match?({_, 0}, res)
end

# @spec apply_proposal(Proposal.t()) :: :ok
# def apply_proposal(
# proposal = %Proposal{description: description, address: address},
# src_dir \\ @src_dir
# ) do
# random = :crypto.strong_rand_bytes(4) |> Base.encode16()
# branch_name = "prop_#{random}_#{Base.encode16(address)}"

# cmd_options = [stderr_to_stdout: true, cd: src_dir]
# git_fn = fn args -> System.cmd("git", args, cmd_options) end

# with {:apply_diff, {_, 0}} <- {:apply_diff, apply_diff(proposal, src_dir, true)},
# {:git_checkout, {_, 0}} <- {:git_checkout, git_fn.(["checkout", "-b", branch_name])},
# {:git_add, {_, 0}} <- {:git_add, git_fn.(["add", "--all"])},
# {:git_commit, {_, 0}} <- {:git_commit, git_fn.(["commit", "-m", description])} do
# :ok
# else
# {:apply_diff, {_, error_code}} ->
# raise "apply_diff_to_current_branch failed with error code #{error_code}"

# {:git_checkout, {_, error_code}} ->
# raise "git_checkout failed with error code #{error_code}"

# {:git_add, {_, error_code}} ->
# raise "git_add failed with error code #{error_code}"

# {:git_commit, {_, error_code}} ->
# raise "git_commit failed with error code #{error_code}"
# end
# end

defp apply_diff(
%Proposal{changes: changes, address: address},
src_dir,
Expand Down
37 changes: 0 additions & 37 deletions scripts/governance/mk-code-proposal.sh

This file was deleted.

0 comments on commit 45a4723

Please sign in to comment.