diff options
author | Arjun Satarkar <me@arjunsatarkar.net> | 2024-07-26 14:20:14 +0000 |
---|---|---|
committer | Arjun Satarkar <me@arjunsatarkar.net> | 2024-07-26 14:23:53 +0000 |
commit | cd794243a5bba358d995e26ba024268e7d5d3f85 (patch) | |
tree | 2df6974cc40f736441f7b985ca95a7f897f4510e /lib/mix/tasks/vendor.ex | |
parent | 37ab5213a368926506206cb21a438cb7fea3d530 (diff) | |
download | mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar.gz mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.zip |
Add Discord Activity functionality (mostly) + general improvements
Diffstat (limited to 'lib/mix/tasks/vendor.ex')
-rw-r--r-- | lib/mix/tasks/vendor.ex | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/mix/tasks/vendor.ex b/lib/mix/tasks/vendor.ex index 1f64236..06e3aa5 100644 --- a/lib/mix/tasks/vendor.ex +++ b/lib/mix/tasks/vendor.ex @@ -3,9 +3,29 @@ defmodule Mix.Tasks.Vendor do @impl Mix.Task def run([]) do - {_, 0} = System.cmd("npm", ~w(install)) + {_, 0} = System.cmd("npm", ~w(install --include=dev)) + File.cp_r!("node_modules/video.js/dist", "priv/static/video.js") File.cp_r!("node_modules/video.js/LICENSE", "priv/static/video.js/LICENSE") + + {_, 0} = System.cmd("npx", ~w(parcel build --target discord-embedded-app-sdk)) + + discord_readme_path = "priv/static/discord-embedded-app-sdk/README.md" + + File.cp_r!( + "node_modules/@discord/embedded-app-sdk/LICENSE.md", + discord_readme_path + ) + + File.write!( + discord_readme_path, + """ + This directory contains a bundled version of https://github.com/discord/embedded-app-sdk/ + See lib/mix/tasks/vendor.ex for how it was generated. The license for the \ + original library is reproduced below:\n + """ <> File.read!(discord_readme_path) + ) + nil end end |