Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Handling of relative importmaps while using watch #7950

Merged

Conversation

Absebo
Copy link
Contributor

@Absebo Absebo commented Oct 12, 2020

Resolves #7831

@CLAassistant
Copy link

CLAassistant commented Oct 12, 2020

CLA assistant check
All committers have signed the CLA.

@Absebo Absebo force-pushed the fix-relative-import-map-with-watch branch from c3e9412 to 94fd528 Compare October 13, 2020 16:19
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +1131 to +1150
fn run_watch_with_importmap_and_relative_paths() {
fn create_relative_tmp_file(
directory: &TempDir,
filename: &'static str,
filecontent: &'static str,
) -> std::path::PathBuf {
let absolute_path = directory.path().join(filename);
std::fs::write(&absolute_path, filecontent).expect("error writing file");
let relative_path = absolute_path
.strip_prefix(util::root_path())
.expect("unable to create relative temporary file")
.to_owned();
assert!(relative_path.is_relative());
relative_path
}
let temp_directory =
TempDir::new_in(util::root_path()).expect("tempdir fail");
let file_to_watch = create_relative_tmp_file(
&temp_directory,
"file_to_watch.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test

@bartlomieju bartlomieju merged commit 1474d5d into denoland:master Oct 19, 2020
@Absebo Absebo deleted the fix-relative-import-map-with-watch branch October 20, 2020 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using watch with importmap requires an absolute path
3 participants